* Every node of the kinds the name-substring index holds, read in * idx_nodes_kind order (kind, file_path, start_line, id): the order its * results break length ties by.
()
| 2603 | * results break length ties by. |
| 2604 | */ |
| 2605 | private readNameSubstringIndex(): { index: NameSubstringIndex; plans: Map<string, ScanOrder | null> } | null { |
| 2606 | const rows = this.db |
| 2607 | .prepare( |
| 2608 | `SELECT rowid AS rowid, kind, name FROM nodes WHERE kind IN (${NAME_SUBSTRING_KINDS.map(() => '?').join(',')})` |
| 2609 | + ' ORDER BY kind, file_path, start_line, id' |
| 2610 | ) |
| 2611 | .all(...NAME_SUBSTRING_KINDS) as Array<{ rowid: number; kind: string; name: string }>; |
| 2612 | const index = buildNameSubstringIndex(rows); |
| 2613 | return index ? { index, plans: new Map() } : null; |
| 2614 | } |
| 2615 | |
| 2616 | /** Whole node rows for `rowids`, in that order; a rowid no longer present is skipped. */ |
| 2617 | private getNodeRowsByRowid(rowids: readonly number[]): NodeRow[] { |
no test coverage detected