[DB-SIG] DB API 2.0 - dictionary fetch ?

Brad Clements bkc@murkworks.com
Tue, 1 Aug 2000 09:04:23 -0400


On 1 Aug 2000, at 10:41, M.-A. Lemburg wrote:

> "Billy G. Allie" wrote:
> > 
> > I would like to propose the following change to the API.
> > 
> > Instead of cursor.fetchone() returning a sequence, have it return an
> > object of the class ResultSet.  The class, ResultSet, would emulate a
> > list object with the following additional features:
> > 
> > 1.  The class would have the column names in the result as attributes. 2.
> >  The class would act like a dictionary in that it could be indexed with
> >     a column name.
> > 3.  A copy of the cursor.description attribute is contained in the
> > ResultSet
> >     object.
> > 


Look for SQLDict.py, it's pretty close to this and darn nice too!


Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               AOL-IM: BKClements