From 456d09864486ad1df77da2ed4b2d64da01781c2b Mon Sep 17 00:00:00 2001 From: totoro Date: Tue, 26 Oct 2021 23:52:43 +0200 Subject: [PATCH] [+] add get_count_float_by_full_clause --- controller/hk_sql_utils.anubis | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/controller/hk_sql_utils.anubis b/controller/hk_sql_utils.anubis index b3d8a35..8d308cf 100644 --- a/controller/hk_sql_utils.anubis +++ b/controller/hk_sql_utils.anubis @@ -73,8 +73,21 @@ public define Int )= if sql_query_timeout(db, clause+";", [], "get_count_by_clause") is { - error(_) then 0, - ok(_, cursor, _) then db_get_Int(cursor) + error(sql_error) then println("get_count_by_full_clause SQL ERROR '"+ sql_error.text + "'\n clause ["+clause+";]");0, + ok(_, cursor, _) then println("get_count_by_full_clause OK ["+clause+"]");db_get_Int(cursor) + } +. + +public define Float + get_count_float_by_full_clause + ( + SQLite3DataBase db, + String clause + )= + if sql_query_timeout(db, clause+";", [], "get_count_by_clause") is + { + error(sql_error) then println("get_count_by_full_clause SQL ERROR '"+ sql_error.text + "'\n clause ["+clause+";]");0.0, + ok(_, cursor, _) then println("get_count_by_full_clause OK ["+clause+"]");db_get_Float(cursor) } . -- libgit2 0.21.4