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

Method getFileNodesByNamePrefix

src/db/queries.ts:1787–1798  ·  view source on GitHub ↗

File nodes whose basename starts with `prefix`, without a result cap.

(prefix: string)

Source from the content-addressed store, hash-verified

1785
1786 /** File nodes whose basename starts with `prefix`, without a result cap. */
1787 getFileNodesByNamePrefix(prefix: string): Node[] {
1788 if (!this.stmts.getFileNodesByNamePrefix) {
1789 this.stmts.getFileNodesByNamePrefix = this.db.prepare(
1790 "SELECT * FROM nodes WHERE kind = 'file' AND name >= ? AND name < ? ORDER BY name"
1791 );
1792 }
1793 const rows = this.stmts.getFileNodesByNamePrefix.all(
1794 prefix,
1795 prefix + '￿'
1796 ) as NodeRow[];
1797 return rows.map(rowToNode);
1798 }
1799
1800 /**
1801 * Get nodes by exact qualified name match (uses idx_nodes_qualified_name index)

Callers 1

findRelevantContextMethod · 0.80

Calls 3

mapMethod · 0.80
prepareMethod · 0.65
allMethod · 0.65

Tested by

no test coverage detected