upsert instead of insert to fts_metadata
This commit is contained in:
parent
afaa6659b9
commit
45c2ec7eee
1 changed files with 6 additions and 1 deletions
|
|
@ -59,7 +59,12 @@ export class FullTextSearchCodebaseIndex implements CodebaseIndex {
|
|||
[item.path, chunk.content],
|
||||
);
|
||||
await db.run(
|
||||
"INSERT INTO fts_metadata (id, path, cacheKey, chunkId) VALUES (?, ?, ?, ?)",
|
||||
`INSERT INTO fts_metadata (id, path, cacheKey, chunkId)
|
||||
VALUES (?, ?, ?, ?)
|
||||
ON CONFLICT(id) DO UPDATE SET
|
||||
path = excluded.path,
|
||||
cacheKey = excluded.cacheKey,
|
||||
chunkId = excluded.chunkId`,
|
||||
[lastID, item.path, item.cacheKey, chunk.id],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue