I'm trying to use sqldelight to insert an item, but to also return the id of the item after it's inserted. There doesn't seem to be a way to do this in sqldelight.
I can call something like SELECT last_insert_rowid();
after I do the insert, but is this the best way to move forward?
You can add this command to your .sq file:
lastInsertRowId:
SELECT last_insert_rowid()
;
And it will return you an id
of last inserted row.
Please refer to this issue on Github for more info.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With