Commit fc59f9afc283c6740184488d9c0b5fb4c32c1b67
1 parent
1aa79ba3
add delete_by_clause
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
controller/hk_sql_utils.anubis
| ... | ... | @@ -48,6 +48,23 @@ public define Maybe(One) |
| 48 | 48 | ok(_, _, _) then success(unique) |
| 49 | 49 | }. |
| 50 | 50 | |
| 51 | +public define Maybe(One) | |
| 52 | + delete_by_clause | |
| 53 | + ( | |
| 54 | + SQLite3DataBase db, | |
| 55 | + String table_name, | |
| 56 | + String clause | |
| 57 | + )= | |
| 58 | + if sql_query_timeout(db, | |
| 59 | + "DELETE FROM "+table_name+ | |
| 60 | + " "+ clause +";", | |
| 61 | + [], | |
| 62 | + "delete_by_clause") is | |
| 63 | + { | |
| 64 | + error(_) then failure, | |
| 65 | + ok(_, _, _) then success(unique) | |
| 66 | + }. | |
| 67 | + | |
| 51 | 68 | public define Int |
| 52 | 69 | get_count_by_full_clause |
| 53 | 70 | ( | ... | ... |