Skip to content

Commit 7055088

Browse files
[3.11] gh-101117: Improve accuracy of sqlite3.Cursor.rowcount docs (#104287) (#104381)
The SQLite C API sqlite3_changes() can only be relied upon when the current active statement has been run to completion.
1 parent 846a23d commit 7055088

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Doc/library/sqlite3.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,10 @@ Cursor objects
15161516
``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements;
15171517
is ``-1`` for other statements,
15181518
including :abbr:`CTE (Common Table Expression)` queries.
1519-
It is only updated by the :meth:`execute` and :meth:`executemany` methods.
1519+
It is only updated by the :meth:`execute` and :meth:`executemany` methods,
1520+
after the statement has run to completion.
1521+
This means that any resulting rows must be fetched in order for
1522+
:attr:`!rowcount` to be updated.
15201523

15211524
.. attribute:: row_factory
15221525

0 commit comments

Comments
 (0)