[DB-SIG] Use of record sets
Brad Clements
bkc@murkworks.com
Thu, 5 Apr 2001 08:24:51 -0400
On 3 Apr 2001, at 21:57, John Shafaee wrote:
> The DBFactory module returns query results as a sequence of Records.
> Records are Python UserDict objects that index field data by the
> field(column) name. This is very convenient when interpolating results in a
> string. The above example code would look like the following if written in
> terms of lists of Records:
>
> print "Found id '%s', first name '%s' and last name
> '%s'"%( result['id'], result['first_name'], result['last_name'] )
>
> I was wondering if this is something that you have considered. If not, I
> was wondering what were the proper channels that I would need to go through
> to make this suggestion open to the rest of the Python DB API community.
Look for the module SQLDict.py which does exactly this (and much more)
Much of my Zope/Python work is done with either SQLDict, or at the base db-api level. I
use the db-api level when I need the maximum performance.
I think dict-base (userdicts, whatever) should be a bolt-on above db-api.. Not a
replacement for it.
Brad Clements, bkc@murkworks.com (315)268-1000
http://www.murkworks.com (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com AOL-IM: BKClements