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

Function prepare_cached

src/store/store.c:200–215  ·  view source on GitHub ↗

Prepare a statement (cached). If already prepared, reset+clear. */

Source from the content-addressed store, hash-verified

198
199/* Prepare a statement (cached). If already prepared, reset+clear. */
200static sqlite3_stmt *prepare_cached(cbm_store_t *s, sqlite3_stmt **slot, const char *sql) {
201 if (!s || !s->db) {
202 return NULL;
203 }
204 if (*slot) {
205 sqlite3_reset(*slot);
206 sqlite3_clear_bindings(*slot);
207 return *slot;
208 }
209 int rc = sqlite3_prepare_v2(s->db, sql, CBM_NOT_FOUND, slot, NULL);
210 if (rc != SQLITE_OK) {
211 store_set_error_sqlite(s, "prepare");
212 return NULL;
213 }
214 return *slot;
215}
216
217/* Get ISO-8601 timestamp. */
218static 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 1

store_set_error_sqliteFunction · 0.85

Tested by

no test coverage detected