* 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.
()
| 2619 | * results break length ties by. |
| 2620 | */ |
| 2621 | private readNameSubstringIndex(): { index: NameSubstringIndex; plans: Map<string, ScanOrder | null> } | null { |
| 2622 | const rows = this.db |
| 2623 | .prepare( |
| 2624 | `SELECT rowid AS rowid, kind, name FROM nodes WHERE kind IN (${NAME_SUBSTRING_KINDS.map(() => '?').join(',')})` |
| 2625 | + ' ORDER BY kind, file_path, start_line, id' |
| 2626 | ) |
| 2627 | .all(...NAME_SUBSTRING_KINDS) as Array<{ rowid: number; kind: string; name: string }>; |
| 2628 | const index = buildNameSubstringIndex(rows); |
| 2629 | return index ? { index, plans: new Map() } : null; |
| 2630 | } |
| 2631 | |
| 2632 | /** Whole node rows for `rowids`, in that order; a rowid no longer present is skipped. */ |
| 2633 | private getNodeRowsByRowid(rowids: readonly number[]): NodeRow[] { |
no test coverage detected