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

Source from the content-addressed store, hash-verified

3143/* ── Node batch ─────────────────────────────────────────────────── */
3144
3145int cbm_store_upsert_node_batch(cbm_store_t *s, const cbm_node_t *nodes, int count,
3146 int64_t *out_ids) {
3147 if (count == 0) {
3148 return CBM_STORE_OK;
3149 }
3150
3151 exec_sql(s, "BEGIN IMMEDIATE;");
3152 for (int i = 0; i < count; i++) {
3153 int64_t id = cbm_store_upsert_node(s, &nodes[i]);
3154 if (id == CBM_STORE_ERR) {
3155 exec_sql(s, "ROLLBACK;");
3156 return CBM_STORE_ERR;
3157 }
3158 if (out_ids) {
3159 out_ids[i] = id;
3160 }
3161 }
3162 exec_sql(s, "COMMIT;");
3163 return CBM_STORE_OK;
3164}
3165
3166/* ── Edge CRUD ──────────────────────────────────────────────────── */
3167

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