Commit 626989691473574cf1896048f55f618bd1a9a6c7
1 parent
ef333ee7
add SQLITE3 db_get_integer and simplified version of db_get_string_list
Showing
1 changed file
with
28 additions
and
0 deletions
Show diff stats
database/db_utils.anubis
| @@ -224,6 +224,34 @@ public define List(String) | @@ -224,6 +224,34 @@ public define List(String) | ||
| 224 | }. | 224 | }. |
| 225 | 225 | ||
| 226 | // sqlite3 API | 226 | // sqlite3 API |
| 227 | +public define List(String) | ||
| 228 | + db_get_string_list | ||
| 229 | + ( | ||
| 230 | + One -> SQLite3Row table_cursor | ||
| 231 | + ) = | ||
| 232 | + if table_cursor(unique) is | ||
| 233 | + { | ||
| 234 | + error(sql_error) then logError("DB", db_error(sql_error, "db_get_string_list")); [], | ||
| 235 | + no_more_row then [], //can't find the symbol in the table, because the row is empty | ||
| 236 | + row(explorer) then | ||
| 237 | + with s = text(explorer)(0), | ||
| 238 | + [ s . db_get_string_list(table_cursor)] | ||
| 239 | + }. | ||
| 240 | + | ||
| 241 | +// sqlite3 API | ||
| 242 | +public define Int | ||
| 243 | + db_get_integer | ||
| 244 | + ( | ||
| 245 | + One -> SQLite3Row table_cursor | ||
| 246 | + ) = | ||
| 247 | + if table_cursor(unique) is | ||
| 248 | + { | ||
| 249 | + error(sql_error) then logError("DB", db_error(sql_error, "db_get_integer")); 0, | ||
| 250 | + no_more_row then 0, //can't find the symbol in the table, because the row is empty | ||
| 251 | + row(explorer) then (Int)db_integer(explorer)(0) | ||
| 252 | + }. | ||
| 253 | + | ||
| 254 | +// sqlite3 API | ||
| 227 | public define List(Int) | 255 | public define List(Int) |
| 228 | db_get_integer_list | 256 | db_get_integer_list |
| 229 | ( | 257 | ( |