mirror of https://github.com/python/cpython
bpo-46261: Update `sqlite3.Cursor.lastrowid` docs (GH-30407)
This commit is contained in:
parent
ef5376e69e
commit
b6aa38f1ca
|
@ -845,14 +845,15 @@ Cursor Objects
|
||||||
|
|
||||||
.. attribute:: lastrowid
|
.. attribute:: lastrowid
|
||||||
|
|
||||||
This read-only attribute provides the rowid of the last modified row. It is
|
This read-only attribute provides the row id of the last inserted row. It
|
||||||
only set if you issued an ``INSERT`` or a ``REPLACE`` statement using the
|
is only updated after successful ``INSERT`` or ``REPLACE`` statements
|
||||||
:meth:`execute` method. For operations other than ``INSERT`` or
|
using the :meth:`execute` method. For other statements, after
|
||||||
``REPLACE`` or when :meth:`executemany` is called, :attr:`lastrowid` is
|
:meth:`executemany` or :meth:`executescript`, or if the insertion failed,
|
||||||
set to :const:`None`.
|
the value of ``lastrowid`` is left unchanged. The initial value of
|
||||||
|
``lastrowid`` is :const:`None`.
|
||||||
|
|
||||||
If the ``INSERT`` or ``REPLACE`` statement failed to insert the previous
|
.. note::
|
||||||
successful rowid is returned.
|
Inserts into ``WITHOUT ROWID`` tables are not recorded.
|
||||||
|
|
||||||
.. versionchanged:: 3.6
|
.. versionchanged:: 3.6
|
||||||
Added support for the ``REPLACE`` statement.
|
Added support for the ``REPLACE`` statement.
|
||||||
|
|
Loading…
Reference in New Issue