mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
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:
parent
4abfe6a14b
commit
7470321f81
1 changed files with 4 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue