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

Function hasCodeGraphSchema

src/directory.ts:190–198  ·  view source on GitHub ↗
(dbPath: string, st: fs.Stats)

Source from the content-addressed store, hash-verified

188const schemaProbeCache = new Map<string, { mtimeMs: number; size: number; ok: boolean }>();
189
190function hasCodeGraphSchema(dbPath: string, st: fs.Stats): boolean {
191 if (!st.isFile() || st.size < SQLITE_HEADER_SIZE) return false;
192 const cached = schemaProbeCache.get(dbPath);
193 if (cached && cached.mtimeMs === st.mtimeMs && cached.size === st.size) return cached.ok;
194 const probe = probeSchema(dbPath);
195 const ok = probe === 'schema' || probe === 'unknown';
196 schemaProbeCache.set(dbPath, { mtimeMs: st.mtimeMs, size: st.size, ok });
197 return ok;
198}
199
200/**
201 * What `codegraph.db` holds, asked of SQLite itself through a read-only

Callers 1

isInitializedFunction · 0.85

Calls 3

probeSchemaFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected