Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7055088

Browse filesBrowse 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
Copy full SHA for 7055088

File tree

1 file changed

+4
-1
lines changed
Filter options

1 file changed

+4
-1
lines changed

‎Doc/library/sqlite3.rst

Copy file name to clipboardExpand all lines: Doc/library/sqlite3.rst
+4-1Lines changed: 4 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.