Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for DELETE CASCADE #7367

Open
Tracked by #9526
lukaseder opened this issue Mar 30, 2018 · 1 comment
Open
Tracked by #9526

Add support for DELETE CASCADE #7367

lukaseder opened this issue Mar 30, 2018 · 1 comment

Comments

@lukaseder
Copy link
Member

lukaseder commented Mar 30, 2018

For whatever reason there might be, client DDL may choose not to use the ON DELETE CASCADE clause on foreign key definitions, yet cascading deletes are still desirable. jOOQ has all the required meta information to implement this recursively, and efficiently.

In particular, jOOQ's implementation would only run a single query per table (using semi joins to the original delete command), unlike what might be implemented by users, which would effectively be the N+1 problem.

Some databases might have native support for a CASCADE clause on the DELETE statement. If so, we could take inspiration from their syntax (and definitely generate the syntax instead of emulating it).


See: https://stackoverflow.com/q/49551385/521799

@lukaseder
Copy link
Member Author

We'll look into this more globally in the context of "synthetic DDL" (#9526), as for that latter issue, we'll need some additional infrastructure to correctly model compound statments (see #9645)

@lukaseder lukaseder removed this from To do in 3.13 Other improvements Oct 16, 2020
@lukaseder lukaseder added this to To do in 3.15 Other improvements via automation Apr 27, 2021
@lukaseder lukaseder removed this from To do in 3.15 Other improvements May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant