This mixin includes the inequality methods (>, <, >=, <=) that are defined on objects that can be used in a numeric or string context in SQL.
Example
sql.a.gt("b") //=> a > "b"
sql.a.lt("b") //=> a > "b"
sql.a.gte("b") //=> a >= "b"
sql.a.lte("b") //=> a <= "b"
sql.a.eq("b") //=> a = "b"
define({
sql.x.between([1,2]) => //=> WHERE ((x >= 1) AND (x <= 10))
sql.x.between([1,2]).invert() => //=> WHERE ((x < 1) OR (x > 10))
Arguments
a two element array where the first element it the item to be gte and the second item lte.
patio.sql.BooleanExpression a boolean expression containing the between expression.
function (items){
return new BooleanExpression("AND", new BooleanExpression("gte", this, items[0]), new BooleanExpression("lte", this, items[1]));
}
sql.a.eq("b") //=> a = "b"
Returns
patio.sql.BooleanExpression
inequalityMethod("eq")
sql.a.gt("b") //=> a > "b"
Returns
patio.sql.BooleanExpression
inequalityMethod("gt")
sql.a.gte("b") //=> a >= "b"
Returns
patio.sql.BooleanExpression
inequalityMethod("gte")
sql.a.lt("b") //=> a < "b"
Returns
patio.sql.BooleanExpression
inequalityMethod("lt")
sql.a.lte("b") //=> a <= "b"
Returns
patio.sql.BooleanExpression
inequalityMethod("lte")