Major version update. Major bugfixes. Security vulnerabilites fixed

This commit is contained in:
2026-10-14 03:02:07 +01:00
parent 4e47bd8ce0
commit 7c095f6f16
112 changed files with 2479 additions and 1219 deletions
+21
View File
@@ -0,0 +1,21 @@
import { Database } from "bun:sqlite";
import * as sqliteVec from "sqlite-vec";
import grabDBDir from "../utils/grab-db-dir";
/** Reuse one connection per database file. */
const clientCache = new Map();
export default function grabSQLiteClient({ config }) {
const { db_file_path } = grabDBDir({ config });
const cached = clientCache.get(db_file_path);
if (cached) {
return cached;
}
const SQLiteClient = new Database(db_file_path, {
create: true,
});
sqliteVec.load(SQLiteClient);
if (config.wal_mode) {
SQLiteClient.run("PRAGMA journal_mode = WAL;");
}
clientCache.set(db_file_path, SQLiteClient);
return SQLiteClient;
}