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

Function getCurrentVersion

src/db/migrations.ts:323–333  ·  view source on GitHub ↗
(db: SqliteDatabase)

Source from the content-addressed store, hash-verified

321 * Get the current schema version from the database
322 */
323export function getCurrentVersion(db: SqliteDatabase): number {
324 try {
325 const row = db
326 .prepare('SELECT MAX(version) as version FROM schema_versions')
327 .get() as { version: number | null } | undefined;
328 return row?.version ?? 0;
329 } catch {
330 // Table doesn't exist yet
331 return 0;
332 }
333}
334
335/**
336 * Record a migration as applied

Calls 2

getMethod · 0.65
prepareMethod · 0.65

Tested by 1

stateFunction · 0.72