kgaughan / dbkit

Taking some of the pain out of Python's DB-API
MIT License
6 stars 2 forks source link

Dealing with non-tuple cursors *or* introducing a row factory #3

Closed kgaughan closed 12 years ago

kgaughan commented 12 years ago

The former depends on only on being able to tell if the row is a tuple, with the assumption otherwise being that it's a dict-like object. The may break, however, and will likely be slower than I'd like.

Alternatively, some kind of row factory can be implemented. This would be akin to the way the sqlite3 driver for Python works. This has the advantage of keeping the likes to query_value and query_column fast, but it may slow down query() and query_row().

I'm strongly leading towards the latter.

kgaughan commented 12 years ago

Done! Went down the row factory route.