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

Source from the content-addressed store, hash-verified

4276/* ── Edge batch ─────────────────────────────────────────────────── */
4277
4278int cbm_store_insert_edge_batch(cbm_store_t *s, const cbm_edge_t *edges, int count) {
4279 if (count == 0) {
4280 return CBM_STORE_OK;
4281 }
4282
4283 exec_sql(s, "BEGIN IMMEDIATE;");
4284 for (int i = 0; i < count; i++) {
4285 int64_t id = cbm_store_insert_edge(s, &edges[i]);
4286 if (id == CBM_STORE_ERR) {
4287 exec_sql(s, "ROLLBACK;");
4288 return CBM_STORE_ERR;
4289 }
4290 }
4291 exec_sql(s, "COMMIT;");
4292 return CBM_STORE_OK;
4293}
4294
4295/* ── File hash CRUD ─────────────────────────────────────────────── */
4296

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