Merge pull request #2088 from continuedev/pe/snippets-replace-into
fix: update snippets index to upsert cmds
This commit is contained in:
commit
f4bcb88896
1 changed files with 2 additions and 2 deletions
|
|
@ -217,7 +217,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
|
|||
|
||||
for (const snippet of snippets) {
|
||||
const { lastID } = await db.run(
|
||||
"INSERT INTO code_snippets (path, cacheKey, content, title, startLine, endLine) VALUES (?, ?, ?, ?, ?, ?)",
|
||||
"REPLACE INTO code_snippets (path, cacheKey, content, title, startLine, endLine) VALUES (?, ?, ?, ?, ?, ?)",
|
||||
[
|
||||
addTag.path,
|
||||
addTag.cacheKey,
|
||||
|
|
@ -228,7 +228,7 @@ export class CodeSnippetsCodebaseIndex implements CodebaseIndex {
|
|||
],
|
||||
);
|
||||
await db.run(
|
||||
"INSERT INTO code_snippets_tags (snippetId, tag) VALUES (?, ?)",
|
||||
"REPLACE INTO code_snippets_tags (snippetId, tag) VALUES (?, ?)",
|
||||
[lastID, tagString],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue