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

Source from the content-addressed store, hash-verified

2117/* ── Node batch ─────────────────────────────────────────────────── */
2118
2119int cbm_store_upsert_node_batch(cbm_store_t *s, const cbm_node_t *nodes, int count,
2120 int64_t *out_ids) {
2121 if (count == 0) {
2122 return CBM_STORE_OK;
2123 }
2124
2125 exec_sql(s, "BEGIN IMMEDIATE;");
2126 for (int i = 0; i < count; i++) {
2127 int64_t id = cbm_store_upsert_node(s, &nodes[i]);
2128 if (id == CBM_STORE_ERR) {
2129 exec_sql(s, "ROLLBACK;");
2130 return CBM_STORE_ERR;
2131 }
2132 if (out_ids) {
2133 out_ids[i] = id;
2134 }
2135 }
2136 exec_sql(s, "COMMIT;");
2137 return CBM_STORE_OK;
2138}
2139
2140/* ── Edge CRUD ──────────────────────────────────────────────────── */
2141

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