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

Method deleteResolvedReferences

src/db/queries.ts:4878–4890  ·  view source on GitHub ↗

* Delete resolved references by their IDs

(fromNodeIds: string[])

Source from the content-addressed store, hash-verified

4876 * Delete resolved references by their IDs
4877 */
4878 deleteResolvedReferences(fromNodeIds: string[]): void {
4879 if (fromNodeIds.length === 0) return;
4880 // Chunk under SQLite's parameter limit, matching every other IN-list in
4881 // this file. The internal resolution path uses deleteSpecificResolvedReferences
4882 // instead, but QueryBuilder is part of the public API, so a library consumer
4883 // passing more ids than SQLITE_MAX_VARIABLE_NUMBER (32766 on the bundled
4884 // node:sqlite) would otherwise hit "too many SQL variables". (#540, #1001)
4885 for (let i = 0; i < fromNodeIds.length; i += SQLITE_PARAM_CHUNK_SIZE) {
4886 const chunk = fromNodeIds.slice(i, i + SQLITE_PARAM_CHUNK_SIZE);
4887 const placeholders = chunk.map(() => '?').join(',');
4888 this.db.prepare(`DELETE FROM unresolved_refs WHERE from_node_id IN (${placeholders})`).run(...chunk);
4889 }
4890 }
4891
4892 /**
4893 * Delete specific resolved references by (fromNodeId, referenceName, referenceKind) tuples.

Callers 1

db-perf.test.tsFile · 0.80

Calls 4

mapMethod · 0.80
runMethod · 0.65
prepareMethod · 0.65
joinMethod · 0.45

Tested by

no test coverage detected