Merge pull request #1992 from continuedev/pe/code-snippet-index-issues

fix: `REPLACE INTO` code_snippet table
This commit is contained in:
Patrick Erichsen 2024-08-12 15:27:36 -07:00 • committed by GitHub
commit bf918ecb32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -201,7 +201,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,
@ -212,7 +212,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],
);
}

View file

@ -26,5 +26,5 @@ export const selectContextProviderDescriptions = createSelector(
export const selectUseActiveFile = createSelector(
[(store: RootState) => store.state.config.experimental?.defaultContext],
(defaultContext) => defaultContext?.includes("activeFile"),
(defaultContext) => defaultContext?.includes("activeFile" as any),
);