From 0cd6149f23ba72c9d0a9977740faf94ce7b4975e Mon Sep 17 00:00:00 2001 From: Cedric RICARD Date: Sun, 21 Sep 2008 20:01:53 +0000 Subject: [PATCH] Updating DB Extractors helpers for new SQLITE API --- calexium_lib/database/db_utils.anubis | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+), 0 deletions(-) diff --git a/calexium_lib/database/db_utils.anubis b/calexium_lib/database/db_utils.anubis index eb576db..839d0de 100644 --- a/calexium_lib/database/db_utils.anubis +++ b/calexium_lib/database/db_utils.anubis @@ -87,6 +87,22 @@ public define Maybe(SQLite3HeadersOrRow -> SQLite3Row) public define List(String) db_get_string_list ( + One -> SQLite3Row table_cursor, + List(String) so_far + ) = + if table_cursor(unique) is + { + error(sql_error) then logError("DB", db_error(sql_error, "db_get_string_list")); reverse(so_far), + no_more_row then reverse(so_far), //can't find the symbol in the table, because the row is empty + row(explorer) then + with s = text(explorer)(0), + db_get_string_list(table_cursor, [s . so_far]) + }. + +// Old sqlite3 API +public define List(String) + db_get_string_list + ( SQLite3HeadersOrRow -> SQLite3Row table_cursor, List(String) so_far ) = @@ -115,5 +131,23 @@ public define List(Int) }. +public define List(Int) + db_get_integer_list + ( + One -> SQLite3Row table_cursor, + List(Int) so_far + ) = + if table_cursor(unique) is + { + error(sql_error) then logError("DB", db_error(sql_error, "db_get_integer_list")); reverse(so_far), + no_more_row then reverse(so_far), //can't find the symbol in the table, because the row is empty + row(explorer) then + with s = (Int)db_integer(explorer)(0), + db_get_integer_list(table_cursor, [s . so_far]) + }. + + + + -- libgit2 0.21.4