diff --git a/controller/hk_sql_utils.anubis b/controller/hk_sql_utils.anubis index 034f313..6e14ab2 100644 --- a/controller/hk_sql_utils.anubis +++ b/controller/hk_sql_utils.anubis @@ -169,20 +169,30 @@ public define Int ( SQLite3DataBase db, String table_name, - String clause + String clause, + List(SQLite3Bind) binds )= // with final_clause = if clause = "" then // "" // else // "WHERE "+clause, - if sql_query_timeout(db, "SELECT COUNT(\""+table_name+".id\") FROM "+table_name+" "+clause+";", [], "get_count_by_clause") is + if sql_query_timeout(db, "SELECT COUNT(\""+table_name+".id\") FROM "+table_name+" "+clause+";", binds, "get_count_by_clause") is { error(sql_error) then println("get_count_by_clause SQL ERROR '"+ sql_error.text + "'\n table_name ["+table_name+"]\n clause ["+clause+";]");0, ok(_, cursor, _) then db_get_Int(cursor) } . +public define Int + get_count_by_clause + ( + SQLite3DataBase db, + String table_name, + String clause + )= + get_count_by_clause(db, table_name, clause, []) +. public define Int get_count -- libgit2 0.21.4