module Sequel::SQL::StringMethods

  1. lib/sequel/sql.rb

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).

Methods

Public Instance

  1. ilike
  2. like

Public Instance methods

ilike(*ces)

Create a BooleanExpression case insensitive pattern match of the receiver with the given patterns. See StringExpression.like.

Sequel[:a].ilike('A%') # "a" ILIKE 'A%' ESCAPE '\'
[show source]
    # File lib/sequel/sql.rb
958 def ilike(*ces)
959   StringExpression.like(self, *(ces << {:case_insensitive=>true}))
960 end
like(*ces)

Create a BooleanExpression case sensitive (if the database supports it) pattern match of the receiver with the given patterns. See StringExpression.like.

Sequel[:a].like('A%') # "a" LIKE 'A%' ESCAPE '\'
[show source]
    # File lib/sequel/sql.rb
966 def like(*ces)
967   StringExpression.like(self, *ces)
968 end