This mixin provides SQL string methods such as (like and iLike).
Examplesql.a.like("A%"); //=> "a" LIKE 'A%' sql.a.iLike("A%"); //=> "a" LIKE 'A%' sql.a.like(/^a/); //=> "a" ~* '^a'
define({
Create a patio.sql.BooleanExpression case insensitive pattern match of the receiver with the given patterns. See patio.sql.StringExpression#like.
Examplesql.a.iLike("A%"); //=> "a" LIKE 'A%'Arguments
patio.sql.BooleanExpression
function (expression){ expression = argsToArray(arguments); return StringExpression.like.apply(StringExpression, [this].concat(expression).concat([ {caseInsensitive: true} ])); }
Create a patio.sql.BooleanExpression case sensitive (if the database supports it) pattern match of the receiver with the given patterns. See patio.sql.StringExpression#like.
Examplesql.a.like(/^a/); //=> "a" ~* '^a' sql.a.like("A%"); //=> "a" LIKE 'A%'Arguments
function (expression){ expression = argsToArray(arguments); return StringExpression.like.apply(StringExpression, [this].concat(expression)); }