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

Method insertUnresolvedRefsBatch

src/db/queries.ts:1980–2004  ·  view source on GitHub ↗

* Insert multiple unresolved references in a transaction

(refs: UnresolvedReference[])

Source from the content-addressed store, hash-verified

1978 * Insert multiple unresolved references in a transaction
1979 */
1980 insertUnresolvedRefsBatch(refs: UnresolvedReference[]): void {
1981 if (refs.length === 0) return;
1982 const insert = this.db.transaction(() => {
1983 const rows: unknown[][] = [];
1984 for (const ref of refs) {
1985 rows.push([
1986 ref.fromNodeId,
1987 ref.referenceName,
1988 ref.referenceKind,
1989 ref.line,
1990 ref.column,
1991 ref.candidates ? JSON.stringify(ref.candidates) : null,
1992 ref.filePath ?? '',
1993 ref.language ?? 'unknown',
1994 ]);
1995 }
1996 this.runBatched(
1997 'insertUnresolvedRefs',
1998 'INSERT INTO unresolved_refs (from_node_id, reference_name, reference_kind, line, col, candidates, file_path, language) VALUES ',
1999 '(?,?,?,?,?,?,?,?)',
2000 rows
2001 );
2002 });
2003 insert();
2004 }
2005
2006 /**
2007 * Delete unresolved references from a node

Callers 7

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