Whole node rows for `rowids`, in that order; a rowid no longer present is skipped.
(rowids: readonly number[])
| 2631 | |
| 2632 | /** Whole node rows for `rowids`, in that order; a rowid no longer present is skipped. */ |
| 2633 | private getNodeRowsByRowid(rowids: readonly number[]): NodeRow[] { |
| 2634 | if (rowids.length === 0) return []; |
| 2635 | const byRowid = new Map<number, NodeRow>(); |
| 2636 | for (let i = 0; i < rowids.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 2637 | const chunk = rowids.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 2638 | const rows = this.db |
| 2639 | .prepare(`SELECT rowid AS rowid_, nodes.* FROM nodes WHERE rowid IN (${chunk.map(() => '?').join(',')})`) |
| 2640 | .all(...chunk) as Array<NodeRow & { rowid_: number }>; |
| 2641 | for (const row of rows) byRowid.set(row.rowid_, row); |
| 2642 | } |
| 2643 | const out: NodeRow[] = []; |
| 2644 | for (const rowid of rowids) { |
| 2645 | const row = byRowid.get(rowid); |
| 2646 | if (row) out.push(row); |
| 2647 | } |
| 2648 | return out; |
| 2649 | } |
| 2650 | |
| 2651 | // =========================================================================== |
| 2652 | // Edge Operations |