From d8b4ae2b83f981b1bdc93b3467e6bd563cad6a56 Mon Sep 17 00:00:00 2001 From: totoro Date: Fri, 23 Jun 2017 18:45:38 +0200 Subject: [PATCH] add db_get_string to get the string of the first entry of the first row --- database/db_utils.anubis | 13 +++++++++++++ 1 file changed, 13 insertions(+), 0 deletions(-) diff --git a/database/db_utils.anubis b/database/db_utils.anubis index ffa9664..72a25a9 100644 --- a/database/db_utils.anubis +++ b/database/db_utils.anubis @@ -194,6 +194,19 @@ public define SQLite3Row // -- Extractors HELPERS --------------- +// sqlite3 API +public define String + db_get_String + ( + One -> SQLite3Row table_cursor + ) = + if table_cursor(unique) is + { + error(sql_error) then logError("DB", db_error(sql_error, "db_get_String")); "", + no_more_row then "", //can't find the symbol in the table, because the row is empty + row(explorer) then text(explorer)(0) + }. + public define List(String) db_get_string_list ( -- libgit2 0.21.4