Skip to content

Commit c567029

Browse files
fix: scope libsql upsert query to backend
1 parent 68f858f commit c567029

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎pkg/store/fts.go‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ ON CONFLICT(id) DO UPDATE SET
1313
filepath=excluded.filepath, content=excluded.content, start_line=excluded.start_line,
1414
end_line=excluded.end_line, metadata=excluded.metadata, is_test=excluded.is_test`
1515

16-
const documentEmbeddingUpsertSQL = `INSERT INTO documents (id, filepath, content, start_line, end_line, metadata, is_test, embedding)
17-
VALUES (?, ?, ?, ?, ?, ?, ?, vector(?))
18-
ON CONFLICT(id) DO UPDATE SET
19-
filepath=excluded.filepath, content=excluded.content, start_line=excluded.start_line,
20-
end_line=excluded.end_line, metadata=excluded.metadata, is_test=excluded.is_test,
21-
embedding=excluded.embedding`
22-
2316
const enrichedFTSContentSQL = `COALESCE(content, '') || ' ' || COALESCE(json_extract(metadata, '$.lexical'), '')`
2417

2518
func initDocumentFTS(db *sql.DB) error {

‎pkg/store/libsql.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ import (
2020
_ "github.com/tursodatabase/go-libsql"
2121
)
2222

23+
const documentEmbeddingUpsertSQL = `INSERT INTO documents (id, filepath, content, start_line, end_line, metadata, is_test, embedding)
24+
VALUES (?, ?, ?, ?, ?, ?, ?, vector(?))
25+
ON CONFLICT(id) DO UPDATE SET
26+
filepath=excluded.filepath, content=excluded.content, start_line=excluded.start_line,
27+
end_line=excluded.end_line, metadata=excluded.metadata, is_test=excluded.is_test,
28+
embedding=excluded.embedding`
29+
2330
// LibSQLStore is a vector store using libSQL's native DiskANN-based vector search.
2431
// Unlike sqlite-vec which uses vec0 virtual tables, libSQL uses:
2532
// - F32_BLOB column type for vectors

0 commit comments

Comments
 (0)