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

Function get_journal_mode

tests/test_store_bulk.c:31–44  ·  view source on GitHub ↗

Query journal_mode via a separate read-only connection so the result is * independent of any state held inside the cbm_store_t under test. */

Source from the content-addressed store, hash-verified

29/* Query journal_mode via a separate read-only connection so the result is
30 * independent of any state held inside the cbm_store_t under test. */
31static char *get_journal_mode(const char *db_path) {
32 sqlite3 *db;
33 if (sqlite3_open_v2(db_path, &db, SQLITE_OPEN_READONLY, NULL) != SQLITE_OK)
34 return NULL;
35 sqlite3_stmt *stmt;
36 char *mode = NULL;
37 if (sqlite3_prepare_v2(db, "PRAGMA journal_mode;", -1, &stmt, NULL) == SQLITE_OK) {
38 if (sqlite3_step(stmt) == SQLITE_ROW)
39 mode = strdup((const char *)sqlite3_column_text(stmt, 0));
40 sqlite3_finalize(stmt);
41 }
42 sqlite3_close(db);
43 return mode;
44}
45
46static void make_temp_path(char *buf, size_t n) {
47 snprintf(buf, n, "%s/cmm_bulk_test_%d.db", cbm_tmpdir(), (int)getpid());

Callers 1

test_store_bulk.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected