Is there functionality around, or some feature on the jooq roadmap which 
would implement "upsert" semantics for complete rows?

Example: DuckDB offers nice sugar in the form of "INSERT OR REPLACE INTO" 
(https://duckdb.org/docs/sql/statements/insert#insert-or-replace-into), not 
requiring the ON CONFLICT clause in the SQL statement.

As far as I can tell, jooq could offer similar functionality in the DSL 
such that instead of
```
val numRows = dsl.insertInto(Tables.MyTable)
    .set(Tables.MyTable.ID, mini.id)
    .set(Tables.MyTable.someVal, mini.someVal)
    .onConflict(Tables.MyTable.ID)



*    .doUpdate()    //.set(Tables.MyTable.ID, mini.id)    
.set(Tables.MyTable.someVal, mini.someVal)*    .execute()
```
it would be come possible to use
```
val numRows = dsl.insertInto(Tables.MyTable)
    .set(Tables.MyTable.ID, mini.id)
    .set(Tables.MyTable.someVal, mini.someVal)
    .onConflict(Tables.MyTable.ID)
    *.doReplace()*
    .execute()
```
Semantically only the columns in .set() would be touched, with the 
exception of the .onConflict() columns?

This could make it easier to write simple row-based UPSERTs in jooq?

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jooq-user+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/jooq-user/b20fbd53-4dcb-4560-a1a4-b9524c84708bn%40googlegroups.com.

Reply via email to