mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-96165: Clarify omitting the FROM clause in SQLite queries (#106513)
This commit is contained in:
parent
4bf43710d1
commit
fc7ff1af45
1 changed files with 7 additions and 0 deletions
|
@ -2519,6 +2519,13 @@ Queries now return :class:`!Row` objects:
|
|||
>>> row["RADIUS"] # Column names are case-insensitive.
|
||||
6378
|
||||
|
||||
.. note::
|
||||
|
||||
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
|
||||
``expr AS alias``.
|
||||
|
||||
You can create a custom :attr:`~Cursor.row_factory`
|
||||
that returns each row as a :class:`dict`, with column names mapped to values:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue