* 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.
()
| 2885 | * results break length ties by. |
| 2886 | */ |
| 2887 | private readNameSubstringIndex(): { index: NameSubstringIndex; plans: Map<string, ScanOrder | null> } | null { |
| 2888 | const rows = this.db |
| 2889 | .prepare( |
| 2890 | `SELECT rowid AS rowid, kind, name FROM nodes WHERE kind IN (${NAME_SUBSTRING_KINDS.map(() => '?').join(',')})` |
| 2891 | + ' ORDER BY kind, file_path, start_line, id' |
| 2892 | ) |
| 2893 | .all(...NAME_SUBSTRING_KINDS) as Array<{ rowid: number; kind: string; name: string }>; |
| 2894 | const index = buildNameSubstringIndex(rows); |
| 2895 | return index ? { index, plans: new Map() } : null; |
| 2896 | } |
| 2897 | |
| 2898 | /** Whole node rows for `rowids`, in that order; a rowid no longer present is skipped. */ |
| 2899 | private getNodeRowsByRowid(rowids: readonly number[]): NodeRow[] { |
no test coverage detected