Commit 6df60761dfa8c210f11077476a4a474219c2419a
1 parent
1def082f
[+] get list of DB_id from given SQLite 3 cursor. the DB_id must the first element in the row
Showing
1 changed file
with
25 additions
and
0 deletions
Show diff stats
database/db_get_helpers.anubis
| ... | ... | @@ -184,7 +184,32 @@ public define Maybe(DB_id) |
| 184 | 184 | } |
| 185 | 185 | . |
| 186 | 186 | |
| 187 | +// sqlite3 API | |
| 188 | +public define List(DB_id) | |
| 189 | + db_get_List_DB_id | |
| 190 | + ( | |
| 191 | + One -> SQLite3Row table_cursor, | |
| 192 | + List(DB_id) so_far | |
| 193 | + ) = | |
| 194 | + if table_cursor(unique) is | |
| 195 | + { | |
| 196 | + error(sql_error) then logError("", "DB", db_error(sql_error, "db_get_List_DB_id")); reverse(so_far), | |
| 197 | + no_more_row then reverse(so_far), //can't find the symbol in the table, because the row is empty | |
| 198 | + row(explorer) then | |
| 199 | + with result = (Int)db_integer(explorer)(0), | |
| 200 | + db_get_List_DB_id(table_cursor, [db_id(result) . so_far]) | |
| 201 | + }. | |
| 202 | + | |
| 203 | +public define List(DB_id) | |
| 204 | + db_get_List_DB_id | |
| 205 | + ( | |
| 206 | + One -> SQLite3Row table_cursor | |
| 207 | + ) = | |
| 208 | + db_get_List_DB_id(table_cursor, []). | |
| 209 | + | |
| 210 | + | |
| 187 | 211 | /***********************************/ |
| 212 | + /* SQLAPI */ | |
| 188 | 213 | |
| 189 | 214 | public define List(Int) |
| 190 | 215 | db_get_List_Int | ... | ... |