[DB-SIG] Database Abstraction in Python

Vernon Cole wnvcole at peppermillcas.com
Sat Apr 16 01:08:15 CEST 2005

Tom Haddon wrote:
> Hi,
> I'm new to the list, so please forgive me if this has been covered
before. I searched the archives and wasn't able to find anything, so
here goes...
> I'm interested in database abstraction for Python, and am wondering
what people use for this. Currently I have thrown together a home-grown
class that does database abstraction for MySQL and PostgreSQL for the
functions I need, but I realize this is not the way to go long term. I
did some google searches and it didn't seem like there was real
consensus on what's the best for this in Python. The closest I could see
was ADOdb for Python, but since this seems to be a rewrite of a PHP
framework, I wasn't sure how good/stable/widely-used it was. Is there a
"standard" for this, or is it a matter of personal preference?
  You've heard from the "it can't be done" side so I'll speak up for the
other.  As you have noticed -- there is not a consensus on how to
improve the database abstraction in Python. There is however a large
swell of opinion that it SHOULD be done.  Guido himself has spoken in
favor of a 3.0 version of the Python database API standard.  The
existing 2.0 standard is a very good start, but it leaves too much
undone.  It lacks even such rudimentary constructs as column names. It
supports four different methods of passing parameters to an SQL
statement and is "standard" only in that it requires each module to tell
you which one of the four it uses.
  I am sure that Mark is correct about heads-down dirty hardworking data
base procedures which always must and will be pretty specific to a
single db and operating system.  
  On the other hand, one should be able to write "text book" examples of
how to do simple database operations which will work in pretty much
every case.  We are not there yet.
  Welcome aboard, please share your ideas, any help is welcome.
Vernon Cole

More information about the DB-SIG mailing list