From 5b520e89c57dfc268c2e32a88b4e5b4b7ec4333c Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Thu, 31 Dec 2015 11:12:33 +0000 Subject: [PATCH] dominate: Use a bulk DELETE Signed-off-by: Niels Thykier --- dak/dominate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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): -- 2.39.5