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

Method insertUnresolvedRefsBatch

src/db/queries.ts:2232–2256  ·  view source on GitHub ↗

* Insert multiple unresolved references in a transaction

(refs: UnresolvedReference[])

Source from the content-addressed store, hash-verified

2230 * Insert multiple unresolved references in a transaction
2231 */
2232 insertUnresolvedRefsBatch(refs: UnresolvedReference[]): void {
2233 if (refs.length === 0) return;
2234 const insert = this.db.transaction(() => {
2235 const rows: unknown[][] = [];
2236 for (const ref of refs) {
2237 rows.push([
2238 ref.fromNodeId,
2239 ref.referenceName,
2240 ref.referenceKind,
2241 ref.line,
2242 ref.column,
2243 ref.candidates ? JSON.stringify(ref.candidates) : null,
2244 ref.filePath ?? '',
2245 ref.language ?? 'unknown',
2246 ]);
2247 }
2248 this.runBatched(
2249 'insertUnresolvedRefs',
2250 'INSERT INTO unresolved_refs (from_node_id, reference_name, reference_kind, line, col, candidates, file_path, language) VALUES ',
2251 '(?,?,?,?,?,?,?,?)',
2252 rows
2253 );
2254 });
2255 insert();
2256 }
2257
2258 /**
2259 * Delete unresolved references from a node

Callers 9

storeFileBundleMethod · 0.95
storeExtractionResultMethod · 0.80
syncMethod · 0.80
db-perf.test.tsFile · 0.80

Calls 2

runBatchedMethod · 0.95
transactionMethod · 0.65

Tested by

no test coverage detected