MCPcopy
hub / github.com/colbymchenry/codegraph / createDatabase

Function createDatabase

src/db/sqlite-adapter.ts:137–149  ·  view source on GitHub ↗
(dbPath: string)

Source from the content-addressed store, hash-verified

135 * a process-global would race.
136 */
137export function createDatabase(dbPath: string): { db: SqliteDatabase; backend: SqliteBackend } {
138 try {
139 return { db: new NodeSqliteAdapter(dbPath), backend: 'node-sqlite' };
140 } catch (error) {
141 const msg = error instanceof Error ? error.message : String(error);
142 throw new Error(
143 'Failed to open SQLite via the built-in node:sqlite module.\n' +
144 'CodeGraph requires node:sqlite (Node.js 22.5+). Install the self-contained\n' +
145 'CodeGraph release (it bundles a compatible Node), or run on Node 22.5+.\n' +
146 `Underlying error: ${msg}`
147 );
148 }
149}

Callers 2

initializeMethod · 0.90
openMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected