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.
This commit is contained in:
Erlend E. Aasland 2023-05-11 10:44:31 +02:00 • committed by GitHub
parent 4abfe6a14b
commit 7470321f81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1694,7 +1694,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