[Twisted-Python] About adodb

Dave Peticolas dave at krondo.com
Fri Oct 1 21:01:26 MDT 2004


On Fri, 2004-10-01 at 04:26, Simon wrote:
> Dave, thanks for your reply.
> 
> >I'm not too familiar with ADOdb, what are the benefits?
> Quoting the author:
> "You might ask why Python needs a database abstraction library when
> Python provides the official DB API. Unfortunately the DB API does not
> encapsulate differences in the database implementations. For example, to
> select a limited number of rows, say 10 rows, you would have to use very
> different SQL for different databases. [...]
> These differences are handled by ADOdb (using SelectLimit), but not by
> the Python DB API. Other important database differences transparently
> handled by ADOdb include date-formating, associative arrays (records as
> dictionaries) and LOB-handling."

That sound useful. Does the python adodb implementation allow you to
use datetime objects transparently?


> >By rewrite, do you mean that the new version only uses
> >ADOdb, or have you added ADOdb as a supported back-end?
> ADOdb adds a level of abstraction on top of db-api. I wrote a version of
> ConnectionPool that uses adodb connections instead of the regular dbapi
> connections and cursors. If this is something python developers find
> useful, i don't know. I guess it isn't as necessary as in php (which i'm
> switching from) where no common db-api exists, but I still think it's
> quite a nice thing.

So this would implement a super-set of the adbapi interface, then?
I think this would probably be a useful addition.


> >sqlreflector and row could definitely use a reworking.
> >I don't think they are used much. I think people mainly
> >use adbapi and write their own object mapping system.
> >What sort of things did you have in mind?
> Well mainly validating the data assigned to a rowobject so one can be
> sure it makes it into the db (checking data length, proper dates etc).
> But if row and sqlreflector isn't used I'll probably build something new
> instead of going through that code. I'm thinking of using the db_row
> module (http://opensource.theopalgroup.com) which seems to offer
> efficient row data access.

db_row has already been mentioned on this list as a nice module.
But wouldn't the associative array aspects of adodb eliminate the need
for db_row?

dave






More information about the Twisted-Python mailing list