diff --git a/controller/hk_sql_utils.anubis b/controller/hk_sql_utils.anubis index a3cc7ca..00d330b 100644 --- a/controller/hk_sql_utils.anubis +++ b/controller/hk_sql_utils.anubis @@ -38,15 +38,19 @@ public define Maybe(One) String table_name, List(Int) ids )= - if sql_query_timeout(db, - "DELETE FROM "+table_name+ - " WHERE id IN ("+join(", ", to_List_String(ids))+");", - [], - "delete_from_ids") is - { - error(_) then failure, - ok(_, _, _) then success(unique) - }. + if length(ids) = 0 then + success(unique) + else + if sql_query_timeout(db, + "DELETE FROM "+table_name+ + " WHERE id IN ("+join(", ", to_List_String(ids))+");", + [], + "delete_from_ids") is + { + error(_) then failure, + ok(_, _, _) then success(unique) + } + . public define Maybe(One) delete_by_clause -- libgit2 0.21.4