Commit cb97098d69dd45ce3ab0049b04f60751b60c1af3
1 parent
87fea19b
[+] add db_get_mb_float from table cursor.
Showing
1 changed file
with
15 additions
and
1 deletions
Show diff stats
database/db_get_helpers.anubis
| @@ -151,7 +151,21 @@ public define Float | @@ -151,7 +151,21 @@ public define Float | ||
| 151 | error(sql_error) then logError("", "DB", db_error(sql_error, "db_get_Float")); 0.0, | 151 | error(sql_error) then logError("", "DB", db_error(sql_error, "db_get_Float")); 0.0, |
| 152 | no_more_row then 0.0, | 152 | no_more_row then 0.0, |
| 153 | row(explorer) then db_float(explorer)(0) | 153 | row(explorer) then db_float(explorer)(0) |
| 154 | - }. | 154 | + } |
| 155 | +. | ||
| 156 | + | ||
| 157 | +public define Maybe(Float) | ||
| 158 | + db_get_mb_Float | ||
| 159 | + ( | ||
| 160 | + One -> SQLite3Row table_cursor | ||
| 161 | + ) = | ||
| 162 | + if table_cursor(unique) is | ||
| 163 | + { | ||
| 164 | + error(sql_error) then logError("", "DB", db_error(sql_error, "db_get_Float")); failure, | ||
| 165 | + no_more_row then failure, | ||
| 166 | + row(explorer) then success(db_float(explorer)(0)) | ||
| 167 | + } | ||
| 168 | +. | ||
| 155 | 169 | ||
| 156 | // sqlite3 API | 170 | // sqlite3 API |
| 157 | public define DB_id | 171 | public define DB_id |