-
Notifications
You must be signed in to change notification settings - Fork 271
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 using
clause support @ DeleteQueryBuilder
.
#241
Conversation
a485f95
to
c8d2f76
Compare
using(...)
@ DeleteQueryBuilder
.using
clause support @ DeleteQueryBuilder
.
Co-authored-by: Naor Peled <me@naor.dev>
Reverted all the renames and type bloat in |
Awesome! 💯 |
Hi, thanks a lot for this functionality! I was just using it and did notice however that table names provided in the "using" clause are not picked up by the CamelCasePlugin, leading to an error. Using snake case in the using clause does work, but ends up causing type errors since the table name is not recognized. |
I created a PR to address the issue: feedback is appreciated! |
Adding
using
toDeleteQueryBuilder
:allows
mysql
consumers to use additional tables to filter what gets deleted from TDF* (it also allows using joins now, as they were not usable previously). Caveat in spec is you have to repeat yourself and add TDF* again inusing
clause in order to have additional tables (not in TDF*) as part of the query (viausing
or in joins) -delete from t1 using t1, t2
ordelete from t1 using t1 inner join t2
.allows
postgres
consumers to use additional tables to filter what gets deleted from TDF*.* TDF = Table/s deleted from.
closes #177.
Takeaways:
A follow-up PR needs to address
DeleteQueryBuilder.returningAll(...)
. It should now allow passing a table argument (just likeSelectQueryBuilder.selectAll(...)
) so we could havet2.*
.A follow-up PR should add
QueryCreator.deleteFrom([t0, t1])
support.mysql
supports deleting from multiple tables, and current PR is a real tease to our consumers since it allows to filter by additional tables but still delete only from one.