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

Function cbm_store_upsert_node_batch

src/store/store.c:3953–3972  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3951/* ── Node batch ─────────────────────────────────────────────────── */
3952
3953int cbm_store_upsert_node_batch(cbm_store_t *s, const cbm_node_t *nodes, int count,
3954 int64_t *out_ids) {
3955 if (count == 0) {
3956 return CBM_STORE_OK;
3957 }
3958
3959 exec_sql(s, "BEGIN IMMEDIATE;");
3960 for (int i = 0; i < count; i++) {
3961 int64_t id = cbm_store_upsert_node(s, &nodes[i]);
3962 if (id == CBM_STORE_ERR) {
3963 exec_sql(s, "ROLLBACK;");
3964 return CBM_STORE_ERR;
3965 }
3966 if (out_ids) {
3967 out_ids[i] = id;
3968 }
3969 }
3970 exec_sql(s, "COMMIT;");
3971 return CBM_STORE_OK;
3972}
3973
3974/* ── Edge CRUD ──────────────────────────────────────────────────── */
3975

Callers 1

test_store_nodes.cFile · 0.85

Calls 2

exec_sqlFunction · 0.85
cbm_store_upsert_nodeFunction · 0.85

Tested by

no test coverage detected