8000 [3.11] gh-101117: Improve accuracy of sqlite3.Cursor.rowcount docs (#104287) by erlend-aasland · Pull Request #104381 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.11] gh-101117: Improve accuracy of sqlite3.Cursor.rowcount docs (#104287) #104381 8000

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[3.11] gh-101117: Improve accuracy of sqlite3.Cursor.rowcount docs (#…
…104287)

The SQLite C API sqlite3_changes() can only be relied upon when the
current active statement has been run to completion.
  • Loading branch information
erlend-aasland committed May 11, 2023
commit ad6faecc3065e576ca94f365fdcf34f163815781
5 changes: 4 additions & 1 deletion Doc/library/sqlite3.rst
657F
Original file line numberDiff line number Diff line change
Expand Up @@ -1516,7 +1516,10 @@ Cursor objects
``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements;
is ``-1`` for other statements,
including :abbr:`CTE (Common Table Expression)` queries.
It is only updated by the :meth:`execute` and :meth:`executemany` methods.
It is only updated by the :meth:`execute` and :meth:`executemany` methods,
after the statement has run to completion.
This means that any resulting rows must be fetched in order for
:attr:`!rowcount` to be updated.

.. attribute:: row_factory

Expand Down
0