-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-96165: Clarify omitting the FROM clause in SQLite queries. #106513
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
Conversation
Thanks, Mariusz! I wonder if we should put these hints in their own how-to. @CAM-Gerlach and @ezio-melotti, what do you think? |
I remember noticing the "unusual" query with no Regarding the note itself, I wonder if the wording could be simplified a bit, since in just two sentences it talks about clauses, statements, row, columns, expressions, literals, and aliases. Even though it's correct and understandable, if the reader is not familiar with all the terms, it might take a couple of re-reads to understand it. |
I'm not sure if it's worth. For example, in Django we try to avoid duplicating of 3rd-party documentation. |
We could use diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index f6a8714519..6d9b1c22ce 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -2523,7 +2523,7 @@ Queries now return :class:`!Row` objects:
The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the
above example. In such cases, SQLite returns a single row with columns
- defined by expressions, e.g. literals, with the given aliases
+ defined by expressions, e.g. constant values, with the given names
``expr AS alias``.
You can create a custom :attr:`~Cursor.row_factory` On the other hand, the term |
I think 'literal' is fine in programming language docs ;) |
Thanks @felixxm for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Thanks @felixxm for the PR, and @erlend-aasland for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…ythonGH-106513) (cherry picked from commit fc7ff1a) Co-authored-by: Mariusz Felisiak <[email protected]>
…ythonGH-106513) (cherry picked from commit fc7ff1a) Co-authored-by: Mariusz Felisiak <[email protected]>
GH-106645 is a backport of this pull request to the 3.12 branch. |
GH-106646 is a backport of this pull request to the 3.11 branch. |
@erlend-aasland Thanks 👍 |
…H-106513) (#106646) (cherry picked from commit fc7ff1a) Co-authored-by: Mariusz Felisiak <[email protected]>
…H-106513) (#106645) (cherry picked from commit fc7ff1a) Co-authored-by: Mariusz Felisiak <[email protected]>
📚 Documentation preview 📚: https://cpython-previews--106513.org.readthedocs.build/