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:2441–2456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2439/* ── Edge batch ─────────────────────────────────────────────────── */
2440
2441int cbm_store_insert_edge_batch(cbm_store_t *s, const cbm_edge_t *edges, int count) {
2442 if (count == 0) {
2443 return CBM_STORE_OK;
2444 }
2445
2446 exec_sql(s, "BEGIN IMMEDIATE;");
2447 for (int i = 0; i < count; i++) {
2448 int64_t id = cbm_store_insert_edge(s, &edges[i]);
2449 if (id == CBM_STORE_ERR) {
2450 exec_sql(s, "ROLLBACK;");
2451 return CBM_STORE_ERR;
2452 }
2453 }
2454 exec_sql(s, "COMMIT;");
2455 return CBM_STORE_OK;
2456}
2457
2458/* ── File hash CRUD ─────────────────────────────────────────────── */
2459

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