Return the ROWID of the last inserted row in a SQLite database.
sqlite-last-insert-rowid &key database => rowid
A SQLite database.
sqlite-last-insert-rowid returns the ROWID of the last row that was inserted in database, or 0 if none.
sqlite-last-insert-rowid is not thread-safe, and you will need to ensure that no other thread inserts rows into database in parallel to the insertion of the row and calling
The result rowid is useful when you want to later access a BLOB in the row using sqlite-open-blob.
ROWIDs in SQLite are described in the SQLite documentation: "ROWIDs and the INTEGER PRIMARY KEY" in "CREATE TABLE" https://www.sqlite.org/lang_createtable.html#rowid.
sqlite-last-insert-rowid is called on the database connection, any row insertion into database affects it, even if it is not in the same table or even not the same file (if another file is attached to the connection using the "ATTACH DATABASE" statement). Therefore, there must not be another insertion into database in parallel to the sequence of insertion and calling
These restrictions mirror the underlying limitation of the C function
LispWorks User Guide and Reference Manual - 20 Sep 2017