From: Niels Thykier Date: Thu, 31 Dec 2015 11:12:33 +0000 (+0000) Subject: dominate: Use a bulk DELETE X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=5b520e89c57dfc268c2e32a88b4e5b4b7ec4333c;p=dak.git dominate: Use a bulk DELETE Signed-off-by: Niels Thykier --- diff --git a/dak/dominate.py b/dak/dominate.py index accb0df8..600d1127 100755 --- a/dak/dominate.py +++ b/dak/dominate.py @@ -87,11 +87,11 @@ def deleteAssociations(table, idList, session): query = """ DELETE FROM %s - WHERE id = :id + WHERE id IN :idList """ % table - params = [{'id': id} for id in idList] - if len(params) == 0: + if not idList: return + params = {'idList': tuple(idList)} session.execute(query, params) def doDaDoDa(suite, session):