Open lukaseder opened 4 years ago
While researching how to create deferrable foreign keys in PostgreSQL/Oracle using jOOQ i came across this ticket and https://github.com/jOOQ/jOOQ/issues/8799.
Good to see this improvement on the roadmap/TODO list.
Is there a work-around available to create foreign keys with the deferrable keyword in the mean time?
and #8799.
Thanks for pointing out the duplicate.
Is there a work-around available to create foreign keys with the deferrable keyword in the mean time?
Use plain SQL for your entire DDL query or use an ExecuteListener
to patch the generated SQL. There aren't any plain SQL templates for DDL fragments yet, as this isn't too popular.
As a workaround, maybe it's simpler to just offer plain SQL TableElement
and CustomTableElement
types where users can implement their own syntax for inclusion in CREATE TABLE
and ALTER TABLE
statements. https://github.com/jOOQ/jOOQ/issues/14807
A few RDBMS support
DEFERRABLE
constraints, which we currently don't support in our DDL statement feature set. ADEFERRABLE
constraint is a constraint that is enforced only at the end of a transaction.Such RDBMS include (list will be enhanced after further research):
See also: https://github.com/jOOQ/jOOQ/issues/11211