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

Method getExistingNodeIds

src/db/queries.ts:833–850  ·  view source on GitHub ↗
(ids: readonly string[])

Source from the content-addressed store, hash-verified

831 }
832
833 private getExistingNodeIds(ids: readonly string[]): Set<string> {
834 const out = new Set<string>();
835 if (ids.length === 0) return out;
836
837 const uniqueIds = [...new Set(ids)];
838 for (let i = 0; i < uniqueIds.length; i += SQLITE_PARAM_CHUNK_SIZE) {
839 const chunk = uniqueIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
840 const placeholders = chunk.map(() => '?').join(',');
841 const rows = this.db
842 .prepare(`SELECT id FROM nodes WHERE id IN (${placeholders})`)
843 .all(...chunk) as { id: string }[];
844 for (const row of rows) {
845 out.add(row.id);
846 }
847 }
848
849 return out;
850 }
851
852 /**
853 * Add a node to the cache, evicting oldest if needed

Callers 1

insertEdgesMethod · 0.95

Calls 3

allMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected