MCPcopy Create free account
hub / github.com/QuantiaAI/helm-agents / openDb

Function openDb

packages/persistence/src/sqlite.ts:94–101  ·  view source on GitHub ↗
(dir: string)

Source from the content-addressed store, hash-verified

92
93/** Open (and migrate) the SQLite database under `dir`. */
94export function openDb(dir: string): Db {
95 mkdirSync(dir, { recursive: true });
96 const db = new DatabaseSync(join(dir, "app.db")) as Db;
97 db.exec("PRAGMA journal_mode = WAL;");
98 db.exec("PRAGMA foreign_keys = ON;");
99 db.exec(MIGRATIONS);
100 return db;
101}

Callers 4

constructorMethod · 0.90
freshFunction · 0.85
freshFunction · 0.85

Calls 1

execMethod · 0.80

Tested by 2

freshFunction · 0.68
freshFunction · 0.68