MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / readNameSubstringIndex

Method readNameSubstringIndex

src/db/queries.ts:2621–2630  ·  view source on GitHub ↗

* 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.

()

Source from the content-addressed store, hash-verified

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[] {

Callers 1

Calls 5

buildNameSubstringIndexFunction · 0.90
mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected