-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-96168: Add sqlite3 row factory how-to #99507
gh-96168: Add sqlite3 row factory how-to #99507
Conversation
erlend-aasland
commented
Nov 15, 2022
•
edited by bedevere-bot
Loading
edited by bedevere-bot
- Issue: sqlite3 docs: extract row factory examples into row factory howto #96168
7f95848
to
dc774c6
Compare
dc774c6
to
e985bab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @erlend-aasland .
Overall, I found the examples helpful, and a good balance between concise and detailed. However, maybe this is just me, but to me the section did appear pretty heavy on examples, but without as much explicit focus on solving specific user problems, as would be appropriate for a how-to. In that sense, it almost feels more like a tutorial, having readers learn using row factories by example, as opposed to telling them how to solve specific problems using row factories.
@ezio-melotti , what do you think?
Yeah, maybe... but How To's are recipes. How can I create a foo row factory? How do I use a bar row factory? How do I use the sqlite3.Row row factory? I don't think it matters much that it is example heavy. IMO it is too thin for a tutorial, and definitely too thin for an explanation. |
Ouch, it just occurred to me that the Cursor also has a
So, more prose coming up. >>> import sqlite3
>>> cx = sqlite3.connect(":memory:")
>>> cx.row_factory = sqlite3.Row
>>> cu = cx.cursor()
>>> cx.row_factory = None
>>> cu.row_factory == cx.row_factory
False
>>> cu.connection.row_factory == cx.row_factory
True |
@CAM-Gerlach: I've reworded the reference, hopefully to the better; IMO the current version reflects the difference between the two row factory attributes more clearly. I also removed the example from ab98877; IMO it is superfluous with the now (hopefully) improved reference. Looking forward to your comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed looking pretty good, thanks. Follow-up suggestions are basically just textual tweaks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me now, personally, Just a couple minor suggestions and followups to others' comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment cleaning up my own mess, otherwise LGTM from my side, thanks.
Thanks again y'all for improving this part of the docs. I'm going to land this later today. A lot of back and forth, but IMO totally worth it. |
Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11. |
(cherry picked from commit 8749121) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
GH-99778 is a backport of this pull request to the 3.11 branch. |
(cherry picked from commit 8749121) Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
GH-99779 is a backport of this pull request to the 3.10 branch. |