[CONPY-29] Support pyformat and format paramstyle Created: 2019-11-13  Updated: 2021-02-15  Resolved: 2019-11-14

Status: Closed
Project: MariaDB Connector/Python
Component/s: DBAPI 2.0
Affects Version/s: 0.9.52, 0.9.1
Fix Version/s: 0.9.52

Type: Task Priority: Major
Reporter: Georg Richter Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None


 Description   

Currently only paramstyle 'qmark' is supported. This makes it hard to migrate application which use the pyformat style (which is default in MySQLDB and MySQL Connector/C).

Suggestion: Additionally support the following paramstyles:

1. format

cursor.execute("SELECT a FROM b WHERE id=%s", ('foo',))

2. pyformat

cursor.execute("SELECT a FROM b WHERE id=%(name)s", {'name' : 'foo'}))

mixing paramstyles shouldn't be allowed and should result in a parsing error.


Generated at Thu Feb 08 03:29:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.