--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/9c11fa4c-a325-4bd3-8784-54989d926c26n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/JLccMEQqF1k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO5yGS-upLv7bo9CN%3DE045%3D2Pr1kXwbucRiXA_JQe7KLnw%40mail.gmail.com.
On May 30, 2021, at 10:17 AM, Boris Heismann <boris.h...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAPZkK29PJyMyYYiT%3DOute0cVmLYmyY3Hb0U46JOnODj2EkmXGw%40mail.gmail.com.
Hi Boris,
I’m trying to get a more accurate understanding of “schema changing often enough” – because the way you described your examples, it seems that your code is wired against specific schema versions, not generic database models, in case of which I really suggest you look into coupling your data change management (e.g. via Flyway or Liquibase) to jOOQ’s code generation:
https://blog.jooq.org/2014/06/25/flyway-and-jooq-for-unbeatable-sql-development-productivity/
A lot of folks are doing that even with several database increments per day – this is not extraordinary. If your schema isn’t completely dynamic (but then, you won’t have field("first_name") in your code, because you wouldn’t know about "first_name" fields), then not using the code generation has mostly cons. You already ran into a few. It is common among new jOOQ users to see code generation as a “burden”, a step that is “hard” to get into existing CI pipelines (often because the pipelines may not be as formal as they could be). But if you think this through, you’ll see that you get two big wins:
Going back to your previous email. You were trying to use returning(field("id")) with plain SQL. There are some technical reasons why telling jOOQ the name of that field isn’t enough, if jOOQ doesn’t *know* that’s an identity column of your table("author"). This is just one more example where generated meta data would be helpful, i.e. in some dialects, this may not work, as you found out. I’m reluctant to walk you through workarounds – because… well that would work if you were using the code generator :)
I hope this helps,
Lukas
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/be96af28-2a09-4a8f-a80e-1f869d337caen%40googlegroups.com.