diff options
author | Erlend E. Aasland <erlend.aasland@protonmail.com> | 2023-05-11 10:44:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 10:44:31 +0200 |
commit | 7470321f8171dce96a604ba2c24176837f999ca0 (patch) | |
tree | 0c6af52afdb0a731a5601cfae5fdc4470c1b70ae | |
parent | 4abfe6a14b5be5decbaa3142d9e2549cf2d86c34 (diff) | |
download | cpython-git-7470321f8171dce96a604ba2c24176837f999ca0.tar.gz |
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.
-rw-r--r-- | Doc/library/sqlite3.rst | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 89673b8006..e7129fb3e4 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -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 |