[DB-SIG] Re: db module wrapper

Randall Smith randall at tnr.cc
Tue Aug 24 17:20:23 CEST 2004



M.-A. Lemburg wrote:
> Jonathan M. Franz wrote:
> 
>> Note to Marc: the clarifications as to the descriptor fields and their 
>> meanings we discussed on the python list a long time ago was a big 
>> help - but those clarifications are still outstanding in the spec 
>> itself.  Should I submit a doc patch?
> 
> 
> Yes, please.
> 
>>> I'm mainly programming to API 2.  Config files are used to adapt 
>>> modules that do not completely comply.  In theory, a module that is 
>>> API2 compliant needs no config.
>>
>>
>>
>> We're pretty much at the same point.  A word of warning - watch out 
>> for assumed behaviors.  For example, some modules return the number of 
>> rows affected by an execute as the return value of the execute; Others 
>> do not.  The standard just states that return values are undefined - 
>> hence the ambiguity and different behavior.
> 
> 
> It says "Return values are not defined". You should use .rowcount to
> access the number of affected rows. The reason is that getting this
> information from the database can be an expensive operation; hence
> you don't want to do this for every single call to .execute().
> 
Unless someone suggests otherwise, the wrapper's execute method will 
return None.

Randall


More information about the DB-SIG mailing list