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

Method insertEdge

src/db/queries.ts:2685–2702  ·  view source on GitHub ↗

* Insert a new edge

(edge: Edge)

Source from the content-addressed store, hash-verified

2683 * Insert a new edge
2684 */
2685 insertEdge(edge: Edge): void {
2686 if (!this.stmts.insertEdge) {
2687 this.stmts.insertEdge = this.db.prepare(`
2688 INSERT OR IGNORE INTO edges (source, target, kind, metadata, line, col, provenance)
2689 VALUES (@source, @target, @kind, @metadata, @line, @col, @provenance)
2690 `);
2691 }
2692
2693 this.stmts.insertEdge.run({
2694 source: edge.source,
2695 target: edge.target,
2696 kind: edge.kind,
2697 metadata: edge.metadata ? JSON.stringify(edge.metadata) : null,
2698 line: edge.line ?? null,
2699 col: edge.column ?? null,
2700 provenance: edge.provenance ?? null,
2701 });
2702 }
2703
2704 /**
2705 * Insert multiple edges in a transaction

Callers 2

seedFunction · 0.80

Calls 2

prepareMethod · 0.65
runMethod · 0.65

Tested by 1

seedFunction · 0.64