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

Method insertUnresolvedRefsBatch

src/db/queries.ts:4383–4407  ·  view source on GitHub ↗

* Insert multiple unresolved references in a transaction

(refs: UnresolvedReference[])

Source from the content-addressed store, hash-verified

4381 * Insert multiple unresolved references in a transaction
4382 */
4383 insertUnresolvedRefsBatch(refs: UnresolvedReference[]): void {
4384 if (refs.length === 0) return;
4385 const insert = this.db.transaction(() => {
4386 const rows: unknown[][] = [];
4387 for (const ref of refs) {
4388 rows.push([
4389 ref.fromNodeId,
4390 ref.referenceName,
4391 ref.referenceKind,
4392 ref.line,
4393 ref.column,
4394 ref.candidates ? JSON.stringify(ref.candidates) : null,
4395 ref.filePath ?? '',
4396 ref.language ?? 'unknown',
4397 ]);
4398 }
4399 this.runBatched(
4400 'insertUnresolvedRefs',
4401 'INSERT INTO unresolved_refs (from_node_id, reference_name, reference_kind, line, col, candidates, file_path, language) VALUES ',
4402 '(?,?,?,?,?,?,?,?)',
4403 rows
4404 );
4405 });
4406 insert();
4407 }
4408
4409 /**
4410 * Delete unresolved references from a node

Callers 14

storeFileBundleMethod · 0.95
fixtureFunction · 0.95
storeExtractionResultMethod · 0.80
removeTrackedMethod · 0.80
db-perf.test.tsFile · 0.80
pendingWithPoolFunction · 0.80

Calls 3

runBatchedMethod · 0.95
pushMethod · 0.80
transactionMethod · 0.65

Tested by 2

fixtureFunction · 0.76
pendingWithPoolFunction · 0.64