-
-
Notifications
You must be signed in to change notification settings - Fork 542
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 negating Condition #147
Comments
Related to SeaQL/sea-query#132 |
I have implemented something for this, and it turned out a bit different than I expected going into it. I wound up with new methods (and macros) The unexpected outcome for me was the idea of negating a conjunction or disjunction, instead of "not" being a unary operator.
I am concerned that the If this suits, I could prepare a PR. |
In actually trying to use my approach to solve the problem that I described here (SeaQL/sea-query#143), I discovered that maybe I'm in over my head... The problem is, wrapping a complex condition into a new layer of
prints
Using the commented out line instead of the line above it does emit parentheses. |
Thank you for the effort. I think a 'not()' method is good enough. And 'not_all()' is really only a shorthand for 'all().not()' right? There is no need to have an extra operator 'not_all'. That would pretty much do it! I would appreciate to have a look over the PR. |
Seemingly we can ship this in 0.2 after bumping SeaQuery, cheers |
It is tempting to use
Condition
to build APIs that accept composite filters. However, once aCondition
has been built, there is no way to introspect it (fields are private), and no way to negate it (NOT
operator is exposed onExpr
instead).It would be nice to have either:
Condition::not(&self)
methodCondition
can be introspectedThe text was updated successfully, but these errors were encountered: