MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / createDatabase

Function createDatabase

src/db/sqlite-adapter.ts:223–231  ·  view source on GitHub ↗
(dbPath: string, opts?: { readOnly?: boolean })

Source from the content-addressed store, hash-verified

221 * a process-global would race.
222 */
223export function createDatabase(dbPath: string, opts?: { readOnly?: boolean }): { db: SqliteDatabase; backend: SqliteBackend } {
224 try {
225 return { db: new NodeSqliteAdapter(dbPath, opts), backend: 'node-sqlite' };
226 } catch (error) {
227 // A runtime without node:sqlite says so (NodeSqliteUnavailableError);
228 // anything SQLite itself reported names its code and the path.
229 throw toDatabaseOpenError(error, dbPath);
230 }
231}

Callers 15

store-worker.tsFile · 0.90
resolver-worker.tsFile · 0.90
constructorMethod · 0.90
initializeMethod · 0.90
openMethod · 0.90
pendingFunction · 0.90
graphSnapshotFunction · 0.90
makeLegacyDbFunction · 0.90
edgeSetFunction · 0.90
withDbFunction · 0.90
readEdgesFunction · 0.90

Calls 1

toDatabaseOpenErrorFunction · 0.90

Tested by 11

pendingFunction · 0.72
graphSnapshotFunction · 0.72
makeLegacyDbFunction · 0.72
edgeSetFunction · 0.72
withDbFunction · 0.72
readEdgesFunction · 0.72
assertStructuralFunction · 0.72
pendingV16Function · 0.72
stateFunction · 0.72
presentWindowIndexesFunction · 0.68
spyOnIndexDdlFunction · 0.68