[DB-SIG] PEP249 - Proposed change to DB-API 2.0

chris@onca.catsden.net chris@onca.catsden.net
Fri, 27 Apr 2001 01:35:32 -0700 (PDT)


On Fri, 27 Apr 2001, Chris Cogdon wrote:

> I can certainly see wanting to place a restriction on the paramstyle
> supported if the C API actually supported one or the other of the given
> types. But for the above two databases, there's no excuse. The python DB
> team could very well supply a library to assist API writers in this
> regard.

Just to prove my point a bit, I've written an (lightly tested) helper
utility that will convert a query to a single string in any one of 5
different paramstyles

http://onca.catsden.net/~chris/dbhelper.py

For DB backends that just take simple strings, why cant the API use
something like this to support /all/ the possible paramstyles? This way, I
can switch between mysql and postgresql (which, presumably could be easily
modified to take all 5 paramstyles), and sybase (which only takes
qmark??). by coding for qmark. I dont have to change a thing to switch
between these three :)


   ("`-/")_.-'"``-._        Ch'marr, a.k.a.
    . . `; -._    )-;-,_`)  Chris Cogdon <chmarr@furry.org.au>
   (v_,)'  _  )`-.\  ``-'
  _.- _..-_/ / ((.'       FC1.3: FFH3cmA+>++C++D++H++M++P++R++T+++WZ++Sm++
((,.-'   ((,/   fL               RLCT acl+++d++e+f+++h++i++++jp-sm++