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

Method insertUnresolvedRefsBatch

src/db/queries.ts:4494–4518  ·  view source on GitHub ↗

* Insert multiple unresolved references in a transaction

(refs: UnresolvedReference[])

Source from the content-addressed store, hash-verified

4492 * Insert multiple unresolved references in a transaction
4493 */
4494 insertUnresolvedRefsBatch(refs: UnresolvedReference[]): void {
4495 if (refs.length === 0) return;
4496 const insert = this.db.transaction(() => {
4497 const rows: unknown[][] = [];
4498 for (const ref of refs) {
4499 rows.push([
4500 ref.fromNodeId,
4501 ref.referenceName,
4502 ref.referenceKind,
4503 ref.line,
4504 ref.column,
4505 ref.candidates ? JSON.stringify(ref.candidates) : null,
4506 ref.filePath ?? '',
4507 ref.language ?? 'unknown',
4508 ]);
4509 }
4510 this.runBatched(
4511 'insertUnresolvedRefs',
4512 'INSERT INTO unresolved_refs (from_node_id, reference_name, reference_kind, line, col, candidates, file_path, language) VALUES ',
4513 '(?,?,?,?,?,?,?,?)',
4514 rows
4515 );
4516 });
4517 insert();
4518 }
4519
4520 /**
4521 * 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