-
Notifications
You must be signed in to change notification settings - Fork 139
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
Seems like OR logic is messed up, wrong SQL is generated #895
Comments
@thehappycoder I'm not aware of this issue, if you could provide some more information that could help me track it down. If you could provide a complete example, along with info on the packages you are using I would appreciate it! Thanks for reporting! |
@doug-martin False alarm but maybe a good indicator that documentation should mention this gotcha. To "fix" this, I had to wrap "or" inside "and":
|
I probably assumed that AND and OR logic worked like in Prisma, where wrapping or inside and isn't needed as far as I remember (https://www.prisma.io/docs/reference/api-reference/prisma-client-reference/#or), so I got hit by this gotcha. |
@thehappycoder you are right it shouldn't be needed. Which persistence package are you using? Each one is different based on what's required to use the library. |
@doug-martin I am using typeorm |
* This ensures that groupings are correct
* This ensures that groupings are correct
@thehappycoder this has been addressed in |
@doug-martin seems like v0.23.1 hasn't been published yet on npm |
@vladmelnyk it was just a patch for Let me know if that works. |
Is it a known issue (hard to search something like that)? If not, I'll post more info.
Basically, SQL is generated with a OR b not enclosed in (), and when I add more filters with AND, this is what I get:
a OR b AND c
(in pseudocode) but should get(a OR b) AND c
The text was updated successfully, but these errors were encountered: