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

Function hasForeignDbFile

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

Source from the content-addressed store, hash-verified

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