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

Method getNamesForSegment

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

1228
1229 /** Names containing the given segment (rare-single-word tier). */
1230 getNamesForSegment(segment: string, limit: number): string[] {
1231 if (!this.hasSchema('name_segment_vocab')) return [];
1232 const rows = this.db
1233 .prepare('SELECT name FROM name_segment_vocab WHERE segment = ? ORDER BY length(name) ASC LIMIT ?')
1234 .all(segment, limit) as Array<{ name: string }>;
1235 return rows.map((r) => r.name);
1236 }
1237
1238 /**
1239 * 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