MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_store_insert_edge_batch

Function cbm_store_insert_edge_batch

src/store/store.c:1727–1742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1725/* ── Edge batch ─────────────────────────────────────────────────── */
1726
1727int cbm_store_insert_edge_batch(cbm_store_t *s, const cbm_edge_t *edges, int count) {
1728 if (count == 0) {
1729 return CBM_STORE_OK;
1730 }
1731
1732 exec_sql(s, "BEGIN IMMEDIATE;");
1733 for (int i = 0; i < count; i++) {
1734 int64_t id = cbm_store_insert_edge(s, &edges[i]);
1735 if (id == CBM_STORE_ERR) {
1736 exec_sql(s, "ROLLBACK;");
1737 return CBM_STORE_ERR;
1738 }
1739 }
1740 exec_sql(s, "COMMIT;");
1741 return CBM_STORE_OK;
1742}
1743
1744/* ── File hash CRUD ─────────────────────────────────────────────── */
1745

Callers 1

test_store_edges.cFile · 0.85

Calls 2

exec_sqlFunction · 0.85
cbm_store_insert_edgeFunction · 0.85

Tested by

no test coverage detected