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

Function hasForeignDbFile

src/directory.ts:180–185  ·  view source on GitHub ↗
(projectRoot: string)

Source from the content-addressed store, hash-verified

178 * deletes the file.
179 */
180export function hasForeignDbFile(projectRoot: string): boolean {
181 const dbPath = path.join(getCodeGraphDir(projectRoot), 'codegraph.db');
182 let st: fs.Stats;
183 try { st = fs.statSync(dbPath); } catch { return false; }
184 return st.isFile() && st.size > 0 && probeSchema(dbPath) === 'not-sqlite';
185}
186
187/** A SQLite file header is 100 bytes; anything shorter cannot hold a schema. */
188const SQLITE_HEADER_SIZE = 100;

Callers 2

runInitFunction · 0.90

Calls 3

getCodeGraphDirFunction · 0.85
probeSchemaFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected