From c6986bdf505841a8b1986830603730192594592b Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 16 Sep 2017 11:04:05 +0900 Subject: [PATCH] add generic get_DB_id_by_clause --- controller/hk_sql_utils.anubis | 14 ++++++++++++++ 1 file changed, 14 insertions(+), 0 deletions(-) diff --git a/controller/hk_sql_utils.anubis b/controller/hk_sql_utils.anubis index 7ccf95a..f013b2a 100644 --- a/controller/hk_sql_utils.anubis +++ b/controller/hk_sql_utils.anubis @@ -160,6 +160,20 @@ public define Maybe(Int) get_mb_id_by_clause(db, table_name, "id", clause) . +public define DB_id + get_DB_id_by_clause + ( + SQLite3DataBase db, + String table_name, + String clause + )= + if get_mb_id_by_clause(db, table_name, "id", clause) is + { + failure then none, + success(id) then db_id(id) + } +. + public define Maybe(One -> SQLite3Row) get_cursor_by_clause ( -- libgit2 0.21.4