Method: Hash#sql_expr

Defined in:
lib/sequel/extensions/core_extensions.rb

#sql_exprObject

Return a Sequel::SQL::BooleanExpression created from this hash, matching all of the conditions. Rarely do you need to call this explicitly, as Sequel generally assumes that hashes specify this type of condition.

{a: true}.sql_expr # SQL: (a IS TRUE)
{a: 1, b: [2, 3]}.sql_expr # SQL: ((a = 1) AND (b IN (2, 3)))


143
144
145
# File 'lib/sequel/extensions/core_extensions.rb', line 143

def sql_expr
  ::Sequel::SQL::BooleanExpression.from_value_pairs(self)
end