Commit c6986bdf505841a8b1986830603730192594592b
1 parent
974c8566
add generic get_DB_id_by_clause
Showing
1 changed file
with
14 additions
and
0 deletions
Show diff stats
controller/hk_sql_utils.anubis
| ... | ... | @@ -160,6 +160,20 @@ public define Maybe(Int) |
| 160 | 160 | get_mb_id_by_clause(db, table_name, "id", clause) |
| 161 | 161 | . |
| 162 | 162 | |
| 163 | +public define DB_id | |
| 164 | + get_DB_id_by_clause | |
| 165 | + ( | |
| 166 | + SQLite3DataBase db, | |
| 167 | + String table_name, | |
| 168 | + String clause | |
| 169 | + )= | |
| 170 | + if get_mb_id_by_clause(db, table_name, "id", clause) is | |
| 171 | + { | |
| 172 | + failure then none, | |
| 173 | + success(id) then db_id(id) | |
| 174 | + } | |
| 175 | +. | |
| 176 | + | |
| 163 | 177 | public define Maybe(One -> SQLite3Row) |
| 164 | 178 | get_cursor_by_clause |
| 165 | 179 | ( | ... | ... |