diff --git a/controller/hk_sql_utils.anubis b/controller/hk_sql_utils.anubis index 6e14ab2..d7befc1 100644 --- a/controller/hk_sql_utils.anubis +++ b/controller/hk_sql_utils.anubis @@ -310,6 +310,24 @@ public define List(DB_id) get_db_ids_by_full_clause(db, table_name, id_col, full_clause, []) . +public define Maybe(DB_id) + get_db_id_by_full_clause + ( + SQLite3DataBase db, + String table_name, + String id_col, + String full_clause, + List(SQLite3Bind) binds + )= + with the_list = get_db_ids_by_full_clause(db, table_name, id_col, full_clause, binds), + println("list size "+length(the_list)); + if the_list is + { + [] then failure, + [h . _] then success(h) + } +. + public define Maybe(Int) get_mb_id_by_clause ( -- libgit2 0.21.4