MCPcopy Create free account
hub / github.com/ByteYellow/AgentProvenance / insertEdge

Function insertEdge

internal/intent/materialize.go:415–421  ·  view source on GitHub ↗

insertEdge writes a graph edge with a per-persist monotonic id, so the primary key can never collide within a run's diff materialization.

(tx *sql.Tx, runID, from, to, edgeType, now string, seq *int)

Source from the content-addressed store, hash-verified

413// insertEdge writes a graph edge with a per-persist monotonic id, so the primary
414// key can never collide within a run's diff materialization.
415func insertEdge(tx *sql.Tx, runID, from, to, edgeType, now string, seq *int) error {
416 *seq++
417 _, err := tx.Exec(`INSERT INTO graph_edges (id, run_id, from_id, to_id, edge_type, created_at)
418 VALUES (?, ?, ?, ?, ?, ?)`,
419 fmt.Sprintf("edge-%s-%s-%d", edgeType, runID, *seq), runID, from, to, edgeType, now)
420 return err
421}
422
423// --- small string helpers shared across the package ---
424

Callers 1

persistDiffsFunction · 0.85

Calls 1

ExecMethod · 0.65

Tested by

no test coverage detected