Questions to DB-API 2

Steve Holden sholden at holdenweb.com
Mon Feb 24 09:45:56 EST 2003


"Kim Petersen" <kp at kyborg.dk> wrote ...
> Jp Calderone wrote:
> > On Fri, Feb 21, 2003 at 03:00:03AM -0800, Jakob Simon-Gaarde 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? Or why a standard wrapper hasn't been installed around this
> aspect?
>
> >

Well, the lack of a "standard wrapper" for that aspect of SQL wouldn't
obviate the need for a "standard wrapper" to smooth out the discrepancies
between different SQL implementations.

I tried to bring *some* sense to this in the database chapters of "Python
Web Programming", but even I wouldn't claim to have addressed all the
issues. I did, I hope, demonstrate that it is possible to adapt to multiple
back-ends, though. At least I ended up with some code that would (within
limits) drive Access, MS SQL Server and Oracle.

Maybe it *is* time to start work on DB-API v3 ... it would be nice to be
able to adapt more readily to the different parameterization styles required
by the back-ends. It certainly won't be a trivial task, however, so let's
not kid ourselves this is going to happen overnight.

Does anyone want to propose this as an Open Space topic at PyCon (see .sig
below)?

regards
--
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Register for PyCon now!            http://www.python.org/pycon/reg.html







More information about the Python-list mailing list