Skip to content

Commit

Permalink
gh-101117: Improve accuracy of sqlite3.Cursor.rowcount docs (#104287)
Browse files Browse the repository at this point in the history
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 authored May 11, 2023
1 parent 4abfe6a commit 7470321
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Doc/library/sqlite3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7470321

Please sign in to comment.