From cb97098d69dd45ce3ab0049b04f60751b60c1af3 Mon Sep 17 00:00:00 2001 From: totoro Date: Sat, 17 Sep 2022 15:38:51 +0900 Subject: [PATCH] [+] add db_get_mb_float from table cursor. --- database/db_get_helpers.anubis | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/database/db_get_helpers.anubis b/database/db_get_helpers.anubis index ce95a81..56c8827 100644 --- a/database/db_get_helpers.anubis +++ b/database/db_get_helpers.anubis @@ -151,7 +151,21 @@ public define Float error(sql_error) then logError("", "DB", db_error(sql_error, "db_get_Float")); 0.0, no_more_row then 0.0, row(explorer) then db_float(explorer)(0) - }. + } +. + +public define Maybe(Float) + db_get_mb_Float + ( + One -> SQLite3Row table_cursor + ) = + if table_cursor(unique) is + { + error(sql_error) then logError("", "DB", db_error(sql_error, "db_get_Float")); failure, + no_more_row then failure, + row(explorer) then success(db_float(explorer)(0)) + } +. // sqlite3 API public define DB_id -- libgit2 0.21.4