jOOQ 3.7+ understøtter PostgreSQL 9.5's ON CONFLICT klausul:
- https://github.com/jOOQ/jOOQ/issues/4299
- https://www.postgresql.org/docs/ 9.5/static/sql-insert.html
Den fulde PostgreSQL-leverandørspecifikke syntaks er endnu ikke understøttet, men du kan bruge MySQL- eller H2-syntaksen, som begge kan emuleres ved hjælp af PostgreSQL's ON CONFLICT :
MySQL INSERT .. ON DUPLICATE KEY UPDATE :
DSL.using(configuration)
.insertInto(TABLE)
.columns(ID, A, B)
.values(1, "a", "b")
.onDuplicateKeyUpdate()
.set(A, "a")
.set(B, "b")
.execute();
H2 MERGE INTO ..
DSL.using(configuration)
.mergeInto(TABLE, A, B, C)
.values(1, "a", "b")
.execute();