[issue13299] namedtuple row factory for sqlite3
Serhiy Storchaka
report at bugs.python.org
Sun Jan 11 09:05:11 CET 2015
Serhiy Storchaka added the comment:
Here is faster implementation.
$ ./python -m timeit -s "import sqlite3; con = sqlite3.connect(':memory:'); con.row_factory = sqlite3.NamedTupleRow; con.execute('create table t (a, b)')" -s "for i in range(100): con.execute('insert into t values (1, 2)')" -- "con.execute('select * from t').fetchall()"
100 loops, best of 3: 2.74 msec per loop
But it is still 3 times slower than sqlite3.Row.
----------
Added file: http://bugs.python.org/file37673/sqlite_namedtuplerow.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13299>
_______________________________________
More information about the Python-bugs-list
mailing list