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

Method getUnresolvedReferencesBatch

src/db/queries.ts:4533–4556  ·  view source on GitHub ↗

* Get a batch of PENDING unresolved references using LIMIT/OFFSET * pagination. Used to process references in bounded memory chunks; failed * rows are excluded so the batched drain loop terminates once every row * has been attempted.

(offset: number, limit: number)

Source from the content-addressed store, hash-verified

4531 * has been attempted.
4532 */
4533 getUnresolvedReferencesBatch(offset: number, limit: number): UnresolvedReference[] {
4534 if (!this.stmts.getUnresolvedBatch) {
4535 // ORDER BY rowid is load-bearing for the pipelined resolution loop: it
4536 // prefetches batch k+1 at OFFSET batch_k.length while batch k's rows are
4537 // still pending, which is only exact under a stable enumeration. (A plain
4538 // scan and the status index both return rowid order anyway — this pins
4539 // it.)
4540 this.stmts.getUnresolvedBatch = this.db.prepare(
4541 "SELECT * FROM unresolved_refs WHERE status = 'pending' ORDER BY rowid LIMIT ? OFFSET ?"
4542 );
4543 }
4544 const rows = this.stmts.getUnresolvedBatch.all(limit, offset) as UnresolvedRefRow[];
4545 return rows.map((row) => ({
4546 fromNodeId: row.from_node_id,
4547 referenceName: row.reference_name,
4548 referenceKind: row.reference_kind as EdgeKind,
4549 line: row.line,
4550 column: row.col,
4551 candidates: row.candidates ? safeJsonParse(row.candidates, undefined) : undefined,
4552 filePath: row.file_path,
4553 language: row.language as Language,
4554 rowId: row.id,
4555 }));
4556 }
4557
4558 /**
4559 * Keyset variant of {@link getUnresolvedReferencesBatch} for the batched

Callers

nothing calls this directly

Calls 4

safeJsonParseFunction · 0.90
mapMethod · 0.80
prepareMethod · 0.65
allMethod · 0.65

Tested by

no test coverage detected