| 6492 | } |
| 6493 | |
| 6494 | int cbm_config_delete(cbm_config_t *cfg, const char *key) { |
| 6495 | if (!cfg || !key) { |
| 6496 | return CLI_ERR; |
| 6497 | } |
| 6498 | |
| 6499 | sqlite3_stmt *stmt = NULL; |
| 6500 | if (sqlite3_prepare_v2(cfg->db, "DELETE FROM config WHERE key = ?", SQL_NUL_TERM, &stmt, |
| 6501 | NULL) != SQLITE_OK) { |
| 6502 | return CLI_ERR; |
| 6503 | } |
| 6504 | sqlite3_bind_text(stmt, SQL_PARAM_1, key, SQL_NUL_TERM, cbm_sqlite_transient); |
| 6505 | |
| 6506 | int rc = sqlite3_step(stmt) == SQLITE_DONE ? 0 : CLI_ERR; |
| 6507 | sqlite3_finalize(stmt); |
| 6508 | return rc; |
| 6509 | } |
| 6510 | |
| 6511 | /* ── Config CLI subcommand ────────────────────────────────────── */ |
| 6512 |
no outgoing calls
no test coverage detected