Skip to content

Commit fc7ff1a

Browse files
authored
gh-96165: Clarify omitting the FROM clause in SQLite queries (#106513)
1 parent 4bf4371 commit fc7ff1a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/sqlite3.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,6 +2519,13 @@ Queries now return :class:`!Row` objects:
25192519
>>> row["RADIUS"] # Column names are case-insensitive.
25202520
6378
25212521

2522+
.. note::
2523+
2524+
The ``FROM`` clause can be omitted in the ``SELECT`` statement, as in the
2525+
above example. In such cases, SQLite returns a single row with columns
2526+
defined by expressions, e.g. literals, with the given aliases
2527+
``expr AS alias``.
2528+
25222529
You can create a custom :attr:`~Cursor.row_factory`
25232530
that returns each row as a :class:`dict`, with column names mapped to values:
25242531

0 commit comments

Comments
 (0)