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
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 RETURNINGclause 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.
The text was updated successfully, but these errors were encountered:
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 thelast_insert_rowid()
(src).The best way to fix this is to use the
RETURNING
clause aslast_insert_rowid
is not guaranteed to be the row id we inserted.From the doc
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.The text was updated successfully, but these errors were encountered: