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

Source from the content-addressed store, hash-verified

2456/* ── Edge batch ─────────────────────────────────────────────────── */
2457
2458int cbm_store_insert_edge_batch(cbm_store_t *s, const cbm_edge_t *edges, int count) {
2459 if (count == 0) {
2460 return CBM_STORE_OK;
2461 }
2462
2463 exec_sql(s, "BEGIN IMMEDIATE;");
2464 for (int i = 0; i < count; i++) {
2465 int64_t id = cbm_store_insert_edge(s, &edges[i]);
2466 if (id == CBM_STORE_ERR) {
2467 exec_sql(s, "ROLLBACK;");
2468 return CBM_STORE_ERR;
2469 }
2470 }
2471 exec_sql(s, "COMMIT;");
2472 return CBM_STORE_OK;
2473}
2474
2475/* ── File hash CRUD ─────────────────────────────────────────────── */
2476

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