News for hackers. Stuff that matters.
Re:Lesser known parts of Python standard library – Trickster... by Joker_vD on Thursday September 05, 2024 @01:25PM (#41458703)
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.
Re:Lesser known parts of Python standard library – Trickster... by ttyprintk on Friday September 06, 2024 @07:11AM (#41465022)
Implemented as conn.row_factory = sqlite3.Row