Uploaded image for project: 'MariaDB Connector/Python'
  1. MariaDB Connector/Python
  2. CONPY-29

Support pyformat and format paramstyle

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.52, 0.9.1
    • Fix Version/s: 0.9.52
    • Component/s: DBAPI 2.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.

        Attachments

          Activity

            People

            Assignee:
            georg Georg Richter
            Reporter:
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration