From 626989691473574cf1896048f55f618bd1a9a6c7 Mon Sep 17 00:00:00 2001 From: totoro Date: Sun, 13 Nov 2016 21:58:30 +0100 Subject: [PATCH] add SQLITE3 db_get_integer and simplified version of db_get_string_list --- database/db_utils.anubis | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+), 0 deletions(-) diff --git a/database/db_utils.anubis b/database/db_utils.anubis index 5d4f521..e3dd197 100644 --- a/database/db_utils.anubis +++ b/database/db_utils.anubis @@ -224,6 +224,34 @@ public define List(String) }. // sqlite3 API +public define List(String) + db_get_string_list + ( + One -> SQLite3Row table_cursor + ) = + if table_cursor(unique) is + { + error(sql_error) then logError("DB", db_error(sql_error, "db_get_string_list")); [], + no_more_row then [], //can't find the symbol in the table, because the row is empty + row(explorer) then + with s = text(explorer)(0), + [ s . db_get_string_list(table_cursor)] + }. + +// sqlite3 API +public define Int + db_get_integer + ( + One -> SQLite3Row table_cursor + ) = + if table_cursor(unique) is + { + error(sql_error) then logError("DB", db_error(sql_error, "db_get_integer")); 0, + no_more_row then 0, //can't find the symbol in the table, because the row is empty + row(explorer) then (Int)db_integer(explorer)(0) + }. + +// sqlite3 API public define List(Int) db_get_integer_list ( -- libgit2 0.21.4