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

Allow where_in and where_not_in to have empty arrays #34

Closed
Flamenco opened this issue Jul 20, 2018 · 6 comments
Closed

Allow where_in and where_not_in to have empty arrays #34

Flamenco opened this issue Jul 20, 2018 · 6 comments
Milestone

Comments

@Flamenco
Copy link

I have to put many checks in my code for filters because where_in('foo',[]) will throw an error.
Please consider allowing these conditions.

@Flamenco
Copy link
Author

screen shot 2018-07-19 at 2 43 19 pm

@kylefarris
Copy link
Owner

kylefarris commented Jul 26, 2018

Would you rather it just silently ignore it?

@Flamenco
Copy link
Author

Yes. Ignore will be great. No need to encode in SQL.

@kylefarris kylefarris added this to the v2 milestone Jul 26, 2018
kylefarris pushed a commit that referenced this issue Jul 26, 2018
…ve travis build sqlserver as well (hopefull).
@kylefarris
Copy link
Owner

This is officially fixed in the v2 branch. Beta should be out soon.

@kylefarris
Copy link
Owner

@Flamenco Thank you for being so active in reporting issues. A v2 Beta is officially out on NPM. If you wouldn't mind testing it, that would be very much appreciated.

You can install the beta like so:

npm i node-querybuilder@next

If you need to submit issues for it, please prefix the issue with v2Beta:

Thanks again!

@Flamenco
Copy link
Author

@kylefarris I am not sure how you implemented this, but maybe instead of ignoring, replace where_in('foo', []) with false or (1=0) and where_not_in('foo', []) with true or (1=1). I am about to switch over to v2 and I have some complex queries that may have issues.

kylefarris pushed a commit that referenced this issue Feb 1, 2019
…ve travis build sqlserver as well (hopefull).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants