(dbPath: string, st: fs.Stats)
| 188 | const schemaProbeCache = new Map<string, { mtimeMs: number; size: number; ok: boolean }>(); |
| 189 | |
| 190 | function 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 |
no test coverage detected