Re: Idiomatic way to "upsert" while returning ID

2018-05-02 Thread Lukas Eder
Hello, I'm sorry for the delay. I've just stumbled upon this curiosity recently in an unrelated issue: https://github.com/jOOQ/jOOQ/issues/6764 In fact, that's how the MySQL Server operates, see the manual ( https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html): With ON DUPLICATE

Re: Idiomatic way to "upsert" while returning ID

2018-04-20 Thread alamothe
Hi Lukas, Thanks so much for the explanation! This is likely not JOOQ related but... What I'm doing now is: val p = TestOnDuplicateKeyUpdateRow() p.a = "a0" p.b = "b2" val r = TaskContext.get().jooq .insertInto(Tables.TEST_ON_DUPLICATE_KEY_UPDATE) .set(p) .onDuplicateKeyUpdate() .set(p)

Re: Idiomatic way to "upsert" while returning ID

2018-04-16 Thread Lukas Eder
Hello, Thanks for your message. For the record (as this feature has been requested a few times), there is no UpdatableRecord.insertOnDuplicateKeyUpdate() method because the "on duplicate key" semantics is different depending on the database. In MySQL, all unique keys and indexes are considered