From fc59f9afc283c6740184488d9c0b5fb4c32c1b67 Mon Sep 17 00:00:00 2001 From: totoro Date: Tue, 26 Sep 2017 20:45:30 +0200 Subject: [PATCH] add delete_by_clause --- controller/hk_sql_utils.anubis | 17 +++++++++++++++++ 1 file changed, 17 insertions(+), 0 deletions(-) diff --git a/controller/hk_sql_utils.anubis b/controller/hk_sql_utils.anubis index f013b2a..878903b 100644 --- a/controller/hk_sql_utils.anubis +++ b/controller/hk_sql_utils.anubis @@ -48,6 +48,23 @@ public define Maybe(One) ok(_, _, _) then success(unique) }. +public define Maybe(One) + delete_by_clause + ( + SQLite3DataBase db, + String table_name, + String clause + )= + if sql_query_timeout(db, + "DELETE FROM "+table_name+ + " "+ clause +";", + [], + "delete_by_clause") is + { + error(_) then failure, + ok(_, _, _) then success(unique) + }. + public define Int get_count_by_full_clause ( -- libgit2 0.21.4