[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.
This commit is contained in:
Erlend E. Aasland 2023-05-11 11:09:46 +02:00 committed by GitHub
parent 846a23d0b8
commit 7055088500
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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