File tree 1 file changed +9
-8
lines changed 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -845,14 +845,15 @@ Cursor Objects
845
845
846
846
.. attribute :: lastrowid
847
847
848
- This read-only attribute provides the rowid of the last modified row. It is
849
- only set if you issued an ``INSERT `` or a ``REPLACE `` statement using the
850
- :meth: `execute ` method. For operations other than ``INSERT `` or
851
- ``REPLACE `` or when :meth: `executemany ` is called, :attr: `lastrowid ` is
852
- set to :const: `None `.
853
-
854
- If the ``INSERT `` or ``REPLACE `` statement failed to insert the previous
855
- successful rowid is returned.
848
+ This read-only attribute provides the row id of the last inserted row. It
849
+ is only updated after successful ``INSERT `` or ``REPLACE `` statements
850
+ using the :meth: `execute ` method. For other statements, after
851
+ :meth: `executemany ` or :meth: `executescript `, or if the insertion failed,
852
+ the value of ``lastrowid `` is left unchanged. The initial value of
853
+ ``lastrowid `` is :const: `None `.
854
+
855
+ .. note ::
856
+ Inserts into ``WITHOUT ROWID `` tables are not recorded.
856
857
857
858
.. versionchanged :: 3.6
858
859
Added support for the ``REPLACE `` statement.
You can’t perform that action at this time.
0 commit comments