Method: Array#sql_expr
- Defined in:
- lib/sequel/core_sql.rb
#sql_expr ⇒ Object
Return a Sequel::SQL::BooleanExpression created from this array, matching all of the conditions. Rarely do you need to call this explicitly, as Sequel generally assumes that arrays of two element arrays specify this type of condition. One case where it can be necessary to use this is if you are using the object as a value in a filter hash and want to use the = operator instead of the IN operator (which is used by default for arrays of two element arrays).
[[:a, true]].sql_expr # SQL: a IS TRUE
[[:a, 1], [:b, [2, 3]]].sql_expr # SQL: a = 1 AND b IN (2, 3)
61 62 63 |
# File 'lib/sequel/core_sql.rb', line 61 def sql_expr sql_expr_if_all_two_pairs end |