-
-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Helpers that return pk or instance don't work with sqlite3. This is because the sqlite3 JDBC does not return pk when :return-key is set to true but it'll return the last_insert_rowid() (src).
The best way to fix this is to use the RETURNING clause as last_insert_rowid is not guaranteed to be the row id we inserted.
From the doc
returns the rowid of the most recent successful INSERT into a rowid table
Also, this will not work for WITHOUT ROWID tables.
Another advantage of using RETURNING clause is that we don't have to do another DB call to select the instance.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels