On Wed, Aug 25, 2004 at 12:27:28AM -0700, David M. Cook wrote:
> 
> Yeah, it's read-only, though, (no __setitem__), you have to "cast" to a dict
> if you want to use the rows in your app.

Hmmm.  Anything beyond providing the sequence protocol for the result
of a fetchone() is an extension anyway...

> > Example?
> 
> Currently you have to use the "--types" hack if you use a BOOL column type
> (which I only use as a way to communicate to my app how the data should be
> displayed.)  I avoid the --types hack by converting the value to an int
> after retrieval and before setting it back, but I'd rather not have to worry
> about it.

pysqlite3 in CVS now returns True or False as the results for columns
declared as BOOL in the schema:

cursor.execute('create table test(a bool)')
cursor.execute('insert into test(a) values (?)', True)
cursor.execute('select * from test')
row = cursor.fetchone()
assert(row[0] == True)

> > > * I do like the current pysqlite's transparent handling of date/time types.
> 
> > How could it be better?  (of course, pysqlite3's handling is non
> > existent...)
> 
> Works great currently.   I have a need for an interval type, although
> previously I've just used strings and converted them only when I need to add
> them up.

Sounds like I'll need to add date/time handling back at some point.
Python 2.4 will make this easier.

Cheers,

Matt

Reply via email to