The lastrowid API always returns a 0 from libsql-server databases.
For local file and in-memory databases it seems to work fine.
Embedded local databases with sync seem to be fine as well.
To test, I created a python script that uses the libsql-experimental-python package to test against the different connection types.
The script drops a table, creates a table, and then inserts twice, printing the lastrowid after each operation, to which I would expect the result [0, 0, 1, 2] for all the connection types.
Update: this reproduces on latest Python package as well. Steps to fix: (1) verify that the libsql Rust crate returns a proper lastrowid and (2) then audit the Python package.
The
lastrowid
API always returns a0
from libsql-server databases. For local file and in-memory databases it seems to work fine. Embedded local databases with sync seem to be fine as well.To test, I created a python script that uses the libsql-experimental-python package to test against the different connection types. The script drops a table, creates a table, and then inserts twice, printing the
lastrowid
after each operation, to which I would expect the result [0, 0, 1, 2] for all the connection types.Actual results are: