Proper get_manager implementation

This commit is contained in:
topjohnwu
2022-05-19 02:39:57 -07:00
parent 34dded3b25
commit a29ae15ff7
3 changed files with 91 additions and 21 deletions

View File

@@ -359,6 +359,14 @@ int get_db_strings(db_strings &str, int key) {
return 0;
}
void rm_db_strings(int key) {
char *err;
char query[128];
snprintf(query, sizeof(query), "DELETE FROM strings WHERE key == '%s'", DB_STRING_KEYS[key]);
err = db_exec(query);
db_err_cmd(err, return);
}
void exec_sql(int client) {
run_finally f([=]{ close(client); });
string sql = read_string(client);