@lojban/semantic-search-mcp 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/storage.ts +6 -6
package/package.json
CHANGED
package/src/storage.ts
CHANGED
|
@@ -63,10 +63,10 @@ export class VectorStorage {
|
|
|
63
63
|
const sel = await this.db.prepare('SELECT id FROM lines WHERE file_path = ? AND line_number = ?');
|
|
64
64
|
const row = sel.get([filePath, lineNumber]) as { id: number } | undefined;
|
|
65
65
|
if (row == null) throw new Error('Failed to get line id');
|
|
66
|
-
const
|
|
66
|
+
const idInt = BigInt(row.id); // vec0 requires INTEGER primary key; BigInt binds as integer in better-sqlite3
|
|
67
67
|
|
|
68
|
-
(await this.db.prepare('DELETE FROM vec_lines WHERE line_id = ?')).run([
|
|
69
|
-
(await this.db.prepare('INSERT INTO vec_lines (line_id, embedding) VALUES (?, ?)')).run([
|
|
68
|
+
(await this.db.prepare('DELETE FROM vec_lines WHERE line_id = ?')).run([idInt]);
|
|
69
|
+
(await this.db.prepare('INSERT INTO vec_lines (line_id, embedding) VALUES (?, ?)')).run([idInt, embedding.buffer]);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
@@ -87,9 +87,9 @@ export class VectorStorage {
|
|
|
87
87
|
for (const item of lines) {
|
|
88
88
|
insertLine.run([item.filePath, item.lineNumber, item.content]);
|
|
89
89
|
const row = selId.get([item.filePath, item.lineNumber]) as { id: number };
|
|
90
|
-
const
|
|
91
|
-
deleteVec.run([
|
|
92
|
-
insertVec.run([
|
|
90
|
+
const idInt = BigInt(row.id); // vec0 requires INTEGER primary key; BigInt binds as integer in better-sqlite3
|
|
91
|
+
deleteVec.run([idInt]);
|
|
92
|
+
insertVec.run([idInt, item.embedding.buffer]);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|