Successor library to Toucan with a modern and more-extensible API, more consistent behavior, and support for different backends including non-JDBC databases and non-HoneySQL queries. Currently in active beta.
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.
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.