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

Function cbm_store_begin_bulk

src/store/store.c:1210–1222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1208/* ── Bulk write ─────────────────────────────────────────────────── */
1209
1210int cbm_store_begin_bulk(cbm_store_t *s) {
1211 /* Stay in WAL mode throughout. Switching to MEMORY journal mode would
1212 * make the database unrecoverable if the process crashes mid-write,
1213 * because the in-memory rollback journal is lost on crash.
1214 * WAL mode is crash-safe: uncommitted WAL entries are simply discarded
1215 * on the next open. Performance is preserved via synchronous=OFF and a
1216 * larger cache, which are safe with WAL. */
1217 int rc = exec_sql(s, "PRAGMA synchronous = OFF;");
1218 if (rc != CBM_STORE_OK) {
1219 return rc;
1220 }
1221 return exec_sql(s, "PRAGMA cache_size = -65536;"); /* CBM_SZ_64 MB */
1222}
1223
1224int cbm_store_end_bulk(cbm_store_t *s) {
1225 int rc = exec_sql(s, "PRAGMA synchronous = NORMAL;");

Callers 4

cbm_gbuf_flush_to_storeFunction · 0.85
test_store_bulk.cFile · 0.85
test_pipeline.cFile · 0.85

Calls 1

exec_sqlFunction · 0.85

Tested by

no test coverage detected