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

Function state

__tests__/migration-concurrent-opens.test.ts:117–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115 }
116
117 function state(): { version: number; v16Records: number; index: boolean } {
118 const { db } = createDatabase(dbPath, { readOnly: true });
119 try {
120 return {
121 version: getCurrentVersion(db),
122 v16Records: (db.prepare('SELECT COUNT(*) AS n FROM schema_versions WHERE version = 16').get() as { n: number }).n,
123 index: db.prepare("SELECT 1 FROM sqlite_master WHERE type = 'index' AND name = ?").get(V16_INDEX) !== undefined,
124 };
125 } finally {
126 db.close();
127 }
128 }
129
130 function run(args: string[]): Child {
131 const child = spawn(process.execPath, args, {

Calls 5

createDatabaseFunction · 0.90
getCurrentVersionFunction · 0.90
getMethod · 0.65
prepareMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected