You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are several row factory examples scattered around the sqlite3 docs. Most of them in various places in the reference. Suggesting to extract them and create a row factory How-to Guide, in order to clean up the reference and reduce duplication of information.
Seems reasonable to me—short-ish examples are reasonable for a reference, but advice like
If returning a tuple doesn’t suffice and you want name-based access to columns, you should consider setting row_factory to the highly optimized sqlite3.Row type. Row provides both index-based and case-insensitive name-based access to columns with almost no memory overhead. It will probably be better than your own custom dictionary-based approach or even a db_row based solution.
is much more appropriate in a how-to, or perhaps actually an explanation (but there isn't really enough meat for that, and a how-to is certainly closer than a reference here)
Activity
erlend-aasland commentedon Aug 22, 2022
cc. @CAM-Gerlach @ezio-melotti
CAM-Gerlach commentedon Aug 23, 2022
Seems reasonable to me—short-ish examples are reasonable for a reference, but advice like
is much more appropriate in a how-to, or perhaps actually an explanation (but there isn't really enough meat for that, and a how-to is certainly closer than a reference here)
erlend-aasland commentedon Aug 31, 2022
As a first step, I suggest to improve the dict-factory example by:
pythongh-96168: Improve sqlite3 dict_factory example
pythongh-96168: Improve sqlite3 dict_factory example (pythonGH-96457)
pythongh-96168: Improve sqlite3 dict_factory example (pythonGH-96457)
gh-96168: Improve sqlite3 dict_factory example (#96457)
gh-96168: Improve sqlite3 dict_factory example (GH-96457)
gh-96168: Improve sqlite3 dict_factory example (GH-96457)
pythongh-96168: Add sqlite3 row factory how-to
pythongh-96168: Add sqlite3 row factory how-to
pythongh-96168: Add sqlite3 row factory how-to
pythongh-96168: Add sqlite3 row factory how-to
gh-96168: Add sqlite3 row factory how-to (#99507)
pythongh-96168: Add sqlite3 row factory how-to (pythonGH-99507)
pythongh-96168: Add sqlite3 row factory how-to (pythonGH-99507)
gh-96168: Add sqlite3 row factory how-to (GH-99507)
gh-96168: Add sqlite3 row factory how-to (GH-99507)