| 6554 | } |
| 6555 | |
| 6556 | int cbm_config_delete(cbm_config_t *cfg, const char *key) { |
| 6557 | if (!cfg || !key) { |
| 6558 | return CLI_ERR; |
| 6559 | } |
| 6560 | |
| 6561 | sqlite3_stmt *stmt = NULL; |
| 6562 | if (sqlite3_prepare_v2(cfg->db, "DELETE FROM config WHERE key = ?", SQL_NUL_TERM, &stmt, |
| 6563 | NULL) != SQLITE_OK) { |
| 6564 | return CLI_ERR; |
| 6565 | } |
| 6566 | sqlite3_bind_text(stmt, SQL_PARAM_1, key, SQL_NUL_TERM, cbm_sqlite_transient); |
| 6567 | |
| 6568 | int rc = sqlite3_step(stmt) == SQLITE_DONE ? 0 : CLI_ERR; |
| 6569 | sqlite3_finalize(stmt); |
| 6570 | return rc; |
| 6571 | } |
| 6572 | |
| 6573 | /* ── Config CLI subcommand ────────────────────────────────────── */ |
| 6574 |
no outgoing calls
no test coverage detected