From: Erlend E. Aasland Date: Thu, 11 May 2023 08:44:31 +0000 (+0200) Subject: gh-101117: Improve accuracy of sqlite3.Cursor.rowcount docs (#104287) X-Git-Tag: v3.12.0b1~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7470321f8171dce96a604ba2c24176837f999ca0;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index 89673b8006ae..e7129fb3e4de 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