Closed seancorfield closed 4 years ago
There where two things I added for Postgres:
Appending FOR UPDATE to the end of a select statement for locking reads. I believe mysql also has this: https://dev.mysql.com/doc/refman/5.7/en/innodb-locking-reads.html
:suffix
option to sql/for-query
Adding ON CONFLICT (id) UPDATE SET ...<VALUES>...
for upsert. I think mysql also has this along with ON DUPLICATE KEY
All the for-*
SQL builders support a :suffix
option now, which will make the code for your upserts easier to write since you can reuse for-insert
/for-insert-multi
with the ON CONFLICT ...
string passed in as the :suffix
.
@zcaudate wrote some (PostgreSQL-specific) upsert functions and used several of the private functions from
next.jdbc.sql
. Those should be made public in a newnext.jdbc.sql.builder
namespace for folks who want to leverage them.That means documenting them properly and moving tests etc.