-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Introduce op :===
to respect empty or nil filters
#338
Comments
For Empty strings are not explicitly filtered by the library, but we use |
Thank you for your response and consideration of feature request @woylie. Since we utilize Flop as a generic way to dynamically build Ecto queries, modifying the behavior of schemas and their changesets might introduce unintended consequences. Having an empty_values option passed on to We believe that introducing a new operator, We hope you can reconsider adding the |
A bit has changed since you opened the issue. Filter values are now cast and validated depending on the field type and operator. Empty values are filtered here now. Since HTML forms will always produce empty strings for empty inputs, they are nilified at that place. That's where you'd have to conditionally not do that if the operator is |
Is your feature request related to a problem? Please describe.
Currently if you use empty/nil query it ignore the query, I'm totally understand why is it like this:
Describe the solution you'd like
But sometimes I want to search by exact empty value at column, and have proposal to introduce
===
op for such casesDescribe alternatives you've considered
It could any other naming like
exact
Additional context
We use flop not only for phoenix tables, but also for filtering in Ecto contexts, and would love to get empty response instead of ignoring such of the filter and return all rows.
The text was updated successfully, but these errors were encountered: