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

Method getUnresolvedReferencesBatchAfter

src/db/queries.ts:2115–2133  ·  view source on GitHub ↗

* Keyset variant of getUnresolvedReferencesBatch for the batched * resolution loop: seek past the last-seen row id instead of OFFSET-walking. * OFFSET reads re-scan the accumulated failed-row prefix on every batch — * O(failed rows) per read, measured at 54.6s of the kernel-scale ba

(afterRowId: number, limit: number)

Source from the content-addressed store, hash-verified

2113 * the enumeration order is identical to the OFFSET reader's.
2114 */
2115 getUnresolvedReferencesBatchAfter(afterRowId: number, limit: number): UnresolvedReference[] {
2116 if (!this.stmts.getUnresolvedBatchAfter) {
2117 this.stmts.getUnresolvedBatchAfter = this.db.prepare(
2118 "SELECT * FROM unresolved_refs WHERE status = 'pending' AND id > ? ORDER BY id LIMIT ?"
2119 );
2120 }
2121 const rows = this.stmts.getUnresolvedBatchAfter.all(afterRowId, limit) as UnresolvedRefRow[];
2122 return rows.map((row) => ({
2123 fromNodeId: row.from_node_id,
2124 referenceName: row.reference_name,
2125 referenceKind: row.reference_kind as EdgeKind,
2126 line: row.line,
2127 column: row.col,
2128 candidates: row.candidates ? safeJsonParse(row.candidates, undefined) : undefined,
2129 filePath: row.file_path,
2130 language: row.language as Language,
2131 rowId: row.id,
2132 }));
2133 }
2134
2135 /**
2136 * Get all tracked file paths (lightweight — no full FileRecord objects)

Callers 1

Calls 3

safeJsonParseFunction · 0.90
prepareMethod · 0.65
allMethod · 0.65

Tested by

no test coverage detected