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

Function cbm_config_set

src/cli/cli.c:7364–7380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7362}
7363
7364int cbm_config_set(cbm_config_t *cfg, const char *key, const char *value) {
7365 if (!cfg || !key || !value) {
7366 return CLI_ERR;
7367 }
7368
7369 sqlite3_stmt *stmt = NULL;
7370 if (sqlite3_prepare_v2(cfg->db, "INSERT OR REPLACE INTO config (key, value) VALUES (?, ?)",
7371 SQL_NUL_TERM, &stmt, NULL) != SQLITE_OK) {
7372 return CLI_ERR;
7373 }
7374 sqlite3_bind_text(stmt, SQL_PARAM_1, key, SQL_NUL_TERM, cbm_sqlite_transient);
7375 sqlite3_bind_text(stmt, SQL_PARAM_2, value, SQL_NUL_TERM, cbm_sqlite_transient);
7376
7377 int rc = sqlite3_step(stmt) == SQLITE_DONE ? 0 : CLI_ERR;
7378 sqlite3_finalize(stmt);
7379 return rc;
7380}
7381
7382int cbm_config_delete(cbm_config_t *cfg, const char *key) {
7383 if (!cfg || !key) {

Callers 8

cbm_cmd_configFunction · 0.85
test_cli.cFile · 0.85
autoindex_limit_probeFunction · 0.85
test_httpd.cFile · 0.85

Calls

no outgoing calls