[DB-SIG] Some obscurity with paramstyle

Christoph Zwerschke cito at online.de
Mon Jul 18 12:44:14 CEST 2011


Am 18.07.2011 09:33 schrieb M.-A. Lemburg:
 > Not really. The DB-API 2.0 allows for a certain number of binding
 > parameter formats, but you shouldn't really invent more.

My main problem was that the specs do not even properly explain what 
these formats are. E.g. they say 'format' means ANSI C printf format 
codes, and ANSI C means more than just '%s'. So when writing a driver, 
do I need to support '%f' or not? A new version of the PEP should be 
more specific here. I agree wth you it makes sense to reduce the number 
of formats instead of adding more.

Am 18.07.2011 09:52 schrieb M.-A. Lemburg:
 > I'm not opposed to a DB API 3, but since there are only a few
 > things on the table for DB API 3 and the adoption of Python 3.x
 > has just started, so it's not all that urgent.

But you can also see it the other way round. Adoption of Python 3.x is 
so slow because important standards like DB-API or WSGI have not been 
rewritten early enough so nobody knows how to properly implement these. 
Therefore if we want to promote Py 3 it is urgent to do something.

 > Note that we have added quite a few (optional) extensions to the
 > DB API 2 in recent years, so even though the version number and
 > the base set of required features hasn't changed, there are many
 > feature already addresses in the DB API.

But if these are optional, you have the same problem as with the many 
parameter formats. People must catch the warning saying the extension is 
not supported and must write code for both case. At least some of the 
extensions like iterator support should become mandatory in the next 
version of the specs.

-- Christoph


More information about the DB-SIG mailing list