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

Method insertUnresolvedRefsBatch

src/db/queries.ts:4822–4846  ·  view source on GitHub ↗

* Insert multiple unresolved references in a transaction

(refs: UnresolvedReference[])

Source from the content-addressed store, hash-verified

4820 * Insert multiple unresolved references in a transaction
4821 */
4822 insertUnresolvedRefsBatch(refs: UnresolvedReference[]): void {
4823 if (refs.length === 0) return;
4824 const insert = this.db.transaction(() => {
4825 const rows: unknown[][] = [];
4826 for (const ref of refs) {
4827 rows.push([
4828 ref.fromNodeId,
4829 ref.referenceName,
4830 ref.referenceKind,
4831 ref.line,
4832 ref.column,
4833 ref.candidates ? JSON.stringify(ref.candidates) : null,
4834 ref.filePath ?? '',
4835 ref.language ?? 'unknown',
4836 ]);
4837 }
4838 this.runBatched(
4839 'insertUnresolvedRefs',
4840 'INSERT INTO unresolved_refs (from_node_id, reference_name, reference_kind, line, col, candidates, file_path, language) VALUES ',
4841 '(?,?,?,?,?,?,?,?)',
4842 rows
4843 );
4844 });
4845 insert();
4846 }
4847
4848 /**
4849 * Delete unresolved references from a node

Callers 15

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 3

fixtureFunction · 0.76
pendingWithPoolFunction · 0.64
recordStartFunction · 0.64