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

Method getIndexRevision

src/db/queries.ts:4427–4432  ·  view source on GitHub ↗

* The index's revision marker: how far the last sync got, and how many files * it left behind — one query, both numbers. * * This is the cheapest honest answer to "has the index moved since I last * looked". `MAX(indexed_at)` alone is not enough: a sync that only DELETES * files (a br

()

Source from the content-addressed store, hash-verified

4425 * count catches exactly that case.
4426 */
4427 getIndexRevision(): { lastIndexedAt: number | null; fileCount: number } {
4428 const row = this.db
4429 .prepare('SELECT MAX(indexed_at) AS last, COUNT(*) AS files FROM files')
4430 .get() as { last: number | null; files: number } | undefined;
4431 return { lastIndexedAt: row?.last ?? null, fileCount: row?.files ?? 0 };
4432 }
4433
4434 /**
4435 * Files re-indexed strictly after `since` (ms since epoch), newest first.

Callers 1

probeMethod · 0.45

Calls 2

getMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected