-
Notifications
You must be signed in to change notification settings - Fork 19
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
calling where_in with an empty array returns all rows #49
Comments
Personally, I think that is the appropriate result for this case. When an invalid or empty list is provided, it should probably be ignored. |
When one query returns the empty array, it is not appropriate to return all rows in a second query. This should mirror the behavior of a I end up having to micro-manage every time I use the result set of queries by checking if they are empty. Please reconsider. |
Sorry man, this is a query builder not something that's going to cover every edge case. Really, it should probably throw an error since that's what writing a query like this: If you want it to work like a join or a sub-query, you should probably write it as such. Otherwise, as a general practice for all programming (not just this module), I would suggest checking the outcome of previous queries before using those results in something else. If you don't do that in general, you going to have a lot of surprises in your program. |
The correct generated SQL should be:
IMO your |
This results in
all rows returned
, instead ofno rows returned
.The text was updated successfully, but these errors were encountered: