]> granicus.if.org Git - python/commitdiff
Documented the lastrowid attribute.
authorGerhard Häring <gh@ghaering.de>
Sat, 29 Mar 2008 19:11:52 +0000 (19:11 +0000)
committerGerhard Häring <gh@ghaering.de>
Sat, 29 Mar 2008 19:11:52 +0000 (19:11 +0000)
Doc/library/sqlite3.rst

index 29d5e490b749bfed2f1fe4579cc7c1531e11df7c..85925f4b453fc73b57a6709f71abd5165cc505a2 100644 (file)
@@ -532,6 +532,12 @@ A :class:`Cursor` instance has the following attributes and methods:
    This includes ``SELECT`` statements because we cannot determine the number of
    rows a query produced until all rows were fetched.
 
+.. attribute:: Cursor.lastrowid
+
+   This read-only attribute provides the rowid of the last modified row. It is
+   only set if you issued a ``INSERT`` statement using the :meth:`execute`
+   method. For operations other than ``INSERT`` or when :meth:`executemany` is
+   called, :attr:`lastrowid` is set to :const:`None`.
 
 .. _sqlite3-types: