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

Method readNameSubstringIndex

src/db/queries.ts:2605–2614  ·  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

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

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