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

Function prepare_cached

src/store/store.c:285–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285static sqlite3_stmt *prepare_cached(cbm_store_t *s, sqlite3_stmt **slot, const char *sql) {
286 if (!s || !s->db) {
287 return NULL;
288 }
289 read_batch_renew(s);
290 if (*slot) {
291 sqlite3_reset(*slot);
292 sqlite3_clear_bindings(*slot);
293 return *slot;
294 }
295 int rc = sqlite3_prepare_v2(s->db, sql, CBM_NOT_FOUND, slot, NULL);
296 if (rc != SQLITE_OK) {
297 store_set_error_sqlite(s, "prepare");
298 return NULL;
299 }
300 return *slot;
301}
302
303/* Get ISO-8601 timestamp. */
304static void iso_now(char *buf, size_t sz) {

Callers 15

cbm_store_upsert_projectFunction · 0.85
cbm_store_get_projectFunction · 0.85
cbm_store_list_projectsFunction · 0.85
cbm_store_delete_projectFunction · 0.85
cbm_store_upsert_nodeFunction · 0.85
find_nodes_genericFunction · 0.85
cbm_store_count_nodesFunction · 0.85

Calls 2

read_batch_renewFunction · 0.85
store_set_error_sqliteFunction · 0.85

Tested by

no test coverage detected