Commit d8b4ae2b83f981b1bdc93b3467e6bd563cad6a56

Authored by totoro
1 parent b22d0e08

add db_get_string to get the string of the first entry of the first row

Showing 1 changed file with 13 additions and 0 deletions   Show diff stats
database/db_utils.anubis
... ... @@ -194,6 +194,19 @@ public define SQLite3Row
194 194  
195 195 // -- Extractors HELPERS ---------------
196 196  
  197 +// sqlite3 API
  198 +public define String
  199 + db_get_String
  200 + (
  201 + One -> SQLite3Row table_cursor
  202 + ) =
  203 + if table_cursor(unique) is
  204 + {
  205 + error(sql_error) then logError("DB", db_error(sql_error, "db_get_String")); "",
  206 + no_more_row then "", //can't find the symbol in the table, because the row is empty
  207 + row(explorer) then text(explorer)(0)
  208 + }.
  209 +
197 210 public define List(String)
198 211 db_get_string_list
199 212 (
... ...