Questions to DB-API 2

Daniel Dittmar daniel.dittmar at
Fri Feb 21 15:14:23 CET 2003

Kim Petersen wrote:
> Jp Calderone wrote:
>>   Sadly, DB-API 2 leaves this particular aspect unspecified, and so
>> implementations vary.  If "?" doesn't work, "%s" tends to.  The
>> documentation to the particular module you're using almost certainly
>> describe which format is supported.
> Sadly is the right word - its the one thing that makes it impossible
> to write portable SQL enabled programs with the DB-API - anyone knows
> why this is so?

This is currently being discussed on DB-SIG. Tokenizing SQL to replace the
paceholders is
- difficult
- slow

Changing the placeholder for a driver would also break compatibility with
older versions.

> Or why a standard wrapper hasn't been installed
> around this aspect?

See above. Plus writingf a tokenizer for *all* SQL dialects is even more
difficult. It seems also as if those coding for several databases already
write their own abstraction layers.

There is something happening in that direction, but it isn't clear yet what
the outcome will be.


More information about the Python-list mailing list