[issue13299] namedtuple row factory for sqlite3

Nick Coghlan report at bugs.python.org
Mon Oct 31 01:32:25 CET 2011


New submission from Nick Coghlan <ncoghlan at gmail.com>:

Currently, sqlite3 allows rows to be easily returned as ordinary tuples (default) or sqlite3.Row objects (which allow dict-style access).

collections.namedtuple provides a much nicer interface than sqlite3.Row for accessing ordered data which uses valid Python identifiers for field names, and can also tolerate field names which are *not* valid identifiers.

It would be convenient if sqlite3 provided a row factory along the lines of the one posted here:
http://peter-hoffmann.com/2010/python-sqlite-namedtuple-factory.html

(except with smarter caching on the named tuples)

----------
messages: 146670
nosy: ncoghlan
priority: normal
severity: normal
stage: needs patch
status: open
title: namedtuple row factory for sqlite3
type: feature request
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13299>
_______________________________________


More information about the Python-bugs-list mailing list