mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
db.py: Support pyformat paramstyle
This is used by the MySQL database backend. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
4a355c71cb
commit
2c36c17a18
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ class Connection:
|
||||||
raise ValueError('unsupported database backend')
|
raise ValueError('unsupported database backend')
|
||||||
|
|
||||||
def execute(self, query, params=()):
|
def execute(self, query, params=()):
|
||||||
if self._paramstyle == 'format':
|
if self._paramstyle in ('format', 'pyformat'):
|
||||||
query = query.replace('%', '%%').replace('?', '%s')
|
query = query.replace('%', '%%').replace('?', '%s')
|
||||||
elif self._paramstyle == 'qmark':
|
elif self._paramstyle == 'qmark':
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Add table
Reference in a new issue