[DB-SIG] Abstraction layer confusion, ULA (was Re: Database Abstraction in Python)

M.-A. Lemburg mal at egenix.com
Mon Apr 18 16:37:16 CEST 2005

Anthony Baxter wrote:
> Isn't this the same split that Perl has with it's DBI:DBD?
> In any case, I too would like to see a standard higher level API on top
> of the DB-API - note that this should not be included as part of the DB-API,
> but as an additional API on top of it. This API would be a good candidate
> for the Python standard library - perhaps starting with something like db_row
> or the like.


> And the DB-API needs to be tightened up - in particular things like argument
> passing (binding input variables) and return values from execute are an utter
> utter pain in the arse right now, as they vary across database interfaces. 
> As an example, an update that modifies two columns of a single row returns 
> 1 on some implementations, 2 on others. 
> So in the interests of spurring action, what other parts of the DB-API need
> revision? Let's make a concrete list, then this can actually move forward. 
> Lets put aside all higher-level APIs for the moment - I think that this is 
> better handled in a different PEP. 
> Off the top of my head:
>    connection paramaters
>    execute return values

Uhm, .executeXXX() methods don't have a return value ?!

DB API 2.0 specifies that .rowcount is to be used to access
the number of rows touched in an update, insert, etc.


             This read-only attribute specifies the number of rows that
             the last executeXXX() produced (for DQL statements like
             'select') or affected (for DML statements like 'update' or

             The attribute is -1 in case no executeXXX() has been
             performed on the cursor or the rowcount of the last
             operation is not determinable by the interface. [7]

             Note: Future versions of the DB API specification could
             redefine the latter case to have the object return None
             instead of -1.

>    binding input variables

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Apr 18 2005)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::

More information about the DB-SIG mailing list