Rom-sql: Using string::lower() comparison with an array

Hi!

I’m using ROM v5.1.2 with rom-sql 3.1.0 acessing a postgresql database.

From the code, I understand that there’s some cases in which room supports a call to .is() with an array: https://github.com/rom-rb/rom-sql/blob/4611a760d594c6e3f2ee471462bc8add27df293f/spec/unit/function_spec.rb#L74-L75
However, if I try to do something like:
root.where { string::lower(field).is([“value1”, “value2”]) }
In one of my repositories, I get the error:
Caused by PG::UndefinedFunction: ERROR: operator does not exist: text = record
LINE 1: …" FROM “table” WHERE (LOWER(“table”.“field”) = ('value1…
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.

Is this a bug? Or I’m doing something not support by functions in the where clause?

Hey, sorry for late reply. This looks like a bug. It should create an IN clause instead of using =. Could you report it please?

Done, thanks!

1 Like