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

Method getUnresolvedReferencesBatch

src/db/queries.ts:4644–4667  ·  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

4642 * has been attempted.
4643 */
4644 getUnresolvedReferencesBatch(offset: number, limit: number): UnresolvedReference[] {
4645 if (!this.stmts.getUnresolvedBatch) {
4646 // ORDER BY rowid is load-bearing for the pipelined resolution loop: it
4647 // prefetches batch k+1 at OFFSET batch_k.length while batch k's rows are
4648 // still pending, which is only exact under a stable enumeration. (A plain
4649 // scan and the status index both return rowid order anyway — this pins
4650 // it.)
4651 this.stmts.getUnresolvedBatch = this.db.prepare(
4652 "SELECT * FROM unresolved_refs WHERE status = 'pending' ORDER BY rowid LIMIT ? OFFSET ?"
4653 );
4654 }
4655 const rows = this.stmts.getUnresolvedBatch.all(limit, offset) as UnresolvedRefRow[];
4656 return rows.map((row) => ({
4657 fromNodeId: row.from_node_id,
4658 referenceName: row.reference_name,
4659 referenceKind: row.reference_kind as EdgeKind,
4660 line: row.line,
4661 column: row.col,
4662 candidates: row.candidates ? safeJsonParse(row.candidates, undefined) : undefined,
4663 filePath: row.file_path,
4664 language: row.language as Language,
4665 rowId: row.id,
4666 }));
4667 }
4668
4669 /**
4670 * 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