@ragpipe/plugin-sqlite-vec
Advanced tools
+13
-4
@@ -165,6 +165,15 @@ "use strict"; | ||
| } | ||
| const instance = new import_better_sqlite3.default(options.path); | ||
| instance.pragma("journal_mode = WAL"); | ||
| database = instance; | ||
| return instance; | ||
| try { | ||
| const instance = new import_better_sqlite3.default(options.path); | ||
| instance.pragma("journal_mode = WAL"); | ||
| database = instance; | ||
| return instance; | ||
| } catch (error) { | ||
| if (error instanceof Error && error.message.includes("Could not locate the bindings file")) { | ||
| throw new Error( | ||
| "Failed to load better-sqlite3 native bindings. If you use pnpm, run `pnpm approve-builds` and allow `better-sqlite3`, then reinstall or rebuild with `pnpm rebuild better-sqlite3`." | ||
| ); | ||
| } | ||
| throw error; | ||
| } | ||
| } | ||
@@ -171,0 +180,0 @@ function getRowCount() { |
+13
-4
@@ -118,6 +118,15 @@ // src/vector-store.ts | ||
| } | ||
| const instance = new Database(options.path); | ||
| instance.pragma("journal_mode = WAL"); | ||
| database = instance; | ||
| return instance; | ||
| try { | ||
| const instance = new Database(options.path); | ||
| instance.pragma("journal_mode = WAL"); | ||
| database = instance; | ||
| return instance; | ||
| } catch (error) { | ||
| if (error instanceof Error && error.message.includes("Could not locate the bindings file")) { | ||
| throw new Error( | ||
| "Failed to load better-sqlite3 native bindings. If you use pnpm, run `pnpm approve-builds` and allow `better-sqlite3`, then reinstall or rebuild with `pnpm rebuild better-sqlite3`." | ||
| ); | ||
| } | ||
| throw error; | ||
| } | ||
| } | ||
@@ -124,0 +133,0 @@ function getRowCount() { |
+1
-1
| { | ||
| "name": "@ragpipe/plugin-sqlite-vec", | ||
| "version": "0.1.0-alpha.1", | ||
| "version": "0.1.0-alpha.2", | ||
| "description": "SQLite local vector store plugin for ragpipe", | ||
@@ -5,0 +5,0 @@ "type": "module", |
+13
-2
@@ -15,2 +15,14 @@ # @ragpipe/plugin-sqlite-vec | ||
| If you use `pnpm`, you may also need to approve the native build for `better-sqlite3`: | ||
| ```bash | ||
| pnpm approve-builds | ||
| ``` | ||
| Approve `better-sqlite3`, then reinstall or rebuild if needed: | ||
| ```bash | ||
| pnpm rebuild better-sqlite3 | ||
| ``` | ||
| ## Usage | ||
@@ -103,2 +115,3 @@ | ||
| - `better-sqlite3` is used under the hood and is loaded at runtime by the plugin. | ||
| - In `pnpm` projects, `better-sqlite3` may require `pnpm approve-builds` before the native binding is available. | ||
| - Dimension metadata is persisted so mismatched embedding models fail fast instead of silently returning bad search results. | ||
@@ -109,3 +122,1 @@ | ||
| MIT | ||
| codex resume 019d7b09-39c8-79e1-b2dc-73b37d15753d |
26931
4.22%574
3.24%120
10.09%