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

Method getFileNodesByNamePrefix

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

1769
1770 /** File nodes whose basename starts with `prefix`, without a result cap. */
1771 getFileNodesByNamePrefix(prefix: string): Node[] {
1772 if (!this.stmts.getFileNodesByNamePrefix) {
1773 this.stmts.getFileNodesByNamePrefix = this.db.prepare(
1774 "SELECT * FROM nodes WHERE kind = 'file' AND name >= ? AND name < ? ORDER BY name"
1775 );
1776 }
1777 const rows = this.stmts.getFileNodesByNamePrefix.all(
1778 prefix,
1779 prefix + '￿'
1780 ) as NodeRow[];
1781 return rows.map(rowToNode);
1782 }
1783
1784 /**
1785 * 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