Whole node rows for `rowids`, in that order; a rowid no longer present is skipped.
(rowids: readonly number[])
| 2615 | |
| 2616 | /** Whole node rows for `rowids`, in that order; a rowid no longer present is skipped. */ |
| 2617 | private getNodeRowsByRowid(rowids: readonly number[]): NodeRow[] { |
| 2618 | if (rowids.length === 0) return []; |
| 2619 | const byRowid = new Map<number, NodeRow>(); |
| 2620 | for (let i = 0; i < rowids.length; i += SQLITE_PARAM_CHUNK_SIZE) { |
| 2621 | const chunk = rowids.slice(i, i + SQLITE_PARAM_CHUNK_SIZE); |
| 2622 | const rows = this.db |
| 2623 | .prepare(`SELECT rowid AS rowid_, nodes.* FROM nodes WHERE rowid IN (${chunk.map(() => '?').join(',')})`) |
| 2624 | .all(...chunk) as Array<NodeRow & { rowid_: number }>; |
| 2625 | for (const row of rows) byRowid.set(row.rowid_, row); |
| 2626 | } |
| 2627 | const out: NodeRow[] = []; |
| 2628 | for (const rowid of rowids) { |
| 2629 | const row = byRowid.get(rowid); |
| 2630 | if (row) out.push(row); |
| 2631 | } |
| 2632 | return out; |
| 2633 | } |
| 2634 | |
| 2635 | // =========================================================================== |
| 2636 | // Edge Operations |