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

Method insertEdge

src/db/queries.ts:2669–2686  ·  view source on GitHub ↗

* Insert a new edge

(edge: Edge)

Source from the content-addressed store, hash-verified

2667 * Insert a new edge
2668 */
2669 insertEdge(edge: Edge): void {
2670 if (!this.stmts.insertEdge) {
2671 this.stmts.insertEdge = this.db.prepare(`
2672 INSERT OR IGNORE INTO edges (source, target, kind, metadata, line, col, provenance)
2673 VALUES (@source, @target, @kind, @metadata, @line, @col, @provenance)
2674 `);
2675 }
2676
2677 this.stmts.insertEdge.run({
2678 source: edge.source,
2679 target: edge.target,
2680 kind: edge.kind,
2681 metadata: edge.metadata ? JSON.stringify(edge.metadata) : null,
2682 line: edge.line ?? null,
2683 col: edge.column ?? null,
2684 provenance: edge.provenance ?? null,
2685 });
2686 }
2687
2688 /**
2689 * 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