-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
string::lower() comparison with an array fails #376
Comments
For the record, this is what we should support: root.where { lower(field).in(["value1", "value2"]) } Return types should not be required in |
@solnic I disagree, return type is required to determine the list of available functions/operators. It's not required for common operators such as |
@flash-gordon not sure if I understand - do you mean that we should stop handling function building via method_missing and go the explicit route with a list of available functions? |
@solnic the list of available operators is determined by the expression type: https://github.com/rom-rb/rom-sql/blob/f3ef5817462c4915f37d0523ea2a2ba95c36a9de/lib/rom/sql/type_extensions.rb For instance |
@flash-gordon OK fair enough 😄 so it seems like this bug is caused by the lack of |
Just to add a little comment, the method that seems to support either rom-sql/spec/unit/function_spec.rb Lines 74 to 75 in 4611a76
|
@renatolond actually, it's not intentional - This should be unified somehow, because |
Describe the bug
When using string:lower() in a where statement, if the comparison is with an array, the comparison fails.
To Reproduce
Assuming a table "table" with a string field "field", in any repository do:
Fails with
Expected behavior
The comparison is expected to generate a query with
(LOWER("table"."field") in ('value1', 'value2'))
and the query should workYour environment
The text was updated successfully, but these errors were encountered: