Module: Sequel::SQL::StringMethods
- Included in:
- Dataset, LiteralString, GenericExpression, StringExpression, Symbol
- Defined in:
- lib/sequel/sql.rb
Overview
This module includes the like
and ilike
methods used for pattern matching that are defined on objects that can be used in a string context in SQL (Symbol
, LiteralString
, SQL::GenericExpression
).
Instance Method Summary collapse
-
#ilike(*ces) ⇒ Object
Create a
BooleanExpression
case insensitive pattern match of the receiver with the given patterns. -
#like(*ces) ⇒ Object
Create a
BooleanExpression
case sensitive (if the database supports it) pattern match of the receiver with the given patterns.
Instance Method Details
#ilike(*ces) ⇒ Object
Create a BooleanExpression
case insensitive pattern match of the receiver with the given patterns. See StringExpression.like
.
:a.ilike('A%') # "a" ILIKE 'A%' ESCAPE '\'
925 926 927 |
# File 'lib/sequel/sql.rb', line 925 def ilike(*ces) StringExpression.like(self, *(ces << {:case_insensitive=>true})) end |
#like(*ces) ⇒ Object
Create a BooleanExpression
case sensitive (if the database supports it) pattern match of the receiver with the given patterns. See StringExpression.like
.
:a.like('A%') # "a" LIKE 'A%' ESCAPE '\'
933 934 935 |
# File 'lib/sequel/sql.rb', line 933 def like(*ces) StringExpression.like(self, *ces) end |