Skip to content

Commit 61c95c2

Browse files
authored
Merge pull request #26 from Karthik777/patch-1
query fix to accept dict as parameters
2 parents e180983 + 8aea425 commit 61c95c2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apswutils/db.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,8 @@ def query(
419419
:param params: Parameters to use in that query - an iterable for ``where id = ?``
420420
parameters, or a dictionary for ``where id = :id``
421421
"""
422-
cursor = self.execute(sql, tuple(params or tuple()))
422+
params = params if isinstance(params, dict) else tuple(params or tuple())
423+
cursor = self.execute(sql, params)
423424
cursor.row_trace = cursor_row2dict
424425
yield from cursor
425426

0 commit comments

Comments
 (0)