diff --git a/controller/hk_sql_utils.anubis b/controller/hk_sql_utils.anubis index 8d308cf..929b68e 100644 --- a/controller/hk_sql_utils.anubis +++ b/controller/hk_sql_utils.anubis @@ -179,6 +179,26 @@ public define List(Int) } . +public define List(DB_id) + get_db_ids_by_clause + ( + SQLite3DataBase db, + String table_name, + String id_col, + String clause + )= + with final_clause = if clause = "" then + "" + else + "WHERE "+clause, + + if sql_query_timeout(db, "SELECT \""+id_col+"\" FROM "+table_name+" "+final_clause+";", [], "get_ids_by_clause") is + { + error(_) then [], + ok(_, cursor, _) then db_get_List_DB_id(cursor) + } +. + public define Maybe(Int) get_mb_id_by_clause ( -- libgit2 0.21.4