You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We probably don't want to use the SQLIte function last_insert_rowid() to get the last_pk. Per the docs on last_insert_rowid, this is expected behavior:
For the purposes of this routine, an INSERT is considered to be successful even if it is subsequently rolled back.
Get last rowid
SELECT last_insert_rowid();
0
Now do the transaction and check the row id:
BEGIN TRANSACTION;
INSERT INTO users (username) VALUES ('puppy');
SELECT last_insert_rowid();
1
Roll the transaction back and check the table and rowid:
ROLLBACK;
SELECT last_insert_rowid();
1
The text was updated successfully, but these errors were encountered:
We probably don't want to use the SQLIte function
last_insert_rowid()
to get the last_pk. Per the docs on last_insert_rowid, this is expected behavior:Get last rowid
SELECT last_insert_rowid();
0
Now do the transaction and check the row id:
1
Roll the transaction back and check the table and rowid:
1
The text was updated successfully, but these errors were encountered: