Hi Patryk

1) Yes, you can use the LoaderOptionsStep.onDuplicateKeyUpdate() clause to
run UPSERTs rather than INSERTs:
http://www.jooq.org/javadoc/latest/org/jooq/LoaderOptionsStep.html#onDuplicateKeyUpdate--

This will translate to ON CONFLICT in PostgreSQL 9.5+

2) No, you cannot, through the loader API. I've created a feature request
for this:
https://github.com/jOOQ/jOOQ/issues/5674

Hope this helps,
Lukas

2016-11-17 20:30 GMT+01:00 Patryk Najda <[email protected]>:

> Hi Lukas,
>
> I used jOOQ's Loader API (with Postgres as a DB) successfully for
> bulking/batching INSERT's, where I provided just a Stream<TableRecord>
> and specified bulking / batching params, which has been quite useful.
>
> But now, I'm wondering, if I can do the same for Records which might exist
> in the table (based on their PK), so I have some questions:
>
> 1.) If the corresponding Record will exist in the table, will jOOQ
> automagically update it, or should I specify what should happen "ON
> CONFLICT" ?
> 2.) When using Loader API, is there any possibility to get the IDs of
> records which were either INSERTed or UPDATEd ?
>
> Kind regards,
> Patryk Najda.
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to