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

Method getNamesForSegment

src/db/queries.ts:1164–1170  ·  view source on GitHub ↗

Names containing the given segment (rare-single-word tier).

(segment: string, limit: number)

Source from the content-addressed store, hash-verified

1162
1163 /** Names containing the given segment (rare-single-word tier). */
1164 getNamesForSegment(segment: string, limit: number): string[] {
1165 if (!this.hasSchema('name_segment_vocab')) return [];
1166 const rows = this.db
1167 .prepare('SELECT name FROM name_segment_vocab WHERE segment = ? ORDER BY length(name) ASC LIMIT ?')
1168 .all(segment, limit) as Array<{ name: string }>;
1169 return rows.map((r) => r.name);
1170 }
1171
1172 /**
1173 * Get a node by ID

Calls 4

hasSchemaMethod · 0.95
mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected