|
|
|
|
|
by Joker_vD
645 days ago
|
|
Honestly, the "proper" way should be passing something like this def namedtuple_factory(cursor, row):
fields = [column[0] for column in cursor.description]
cls = namedtuple("Row", fields)
return cls._make(row)
to the fetchall(), to automatically keep the names in sync with those in the SQL query string. |
|