* 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)
| 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 |
nothing calls this directly
no test coverage detected