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({
Arguments
- sql.x.between([1,2]) => //=> WHERE ((x >= 1) AND (x <= 10))
- sql.x.between([1,2]).invert() => //=> WHERE ((x < 1) OR (x > 10))
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]));
- }
Returns
- sql.a.eq("b") //=> a = "b"
patio.sql.BooleanExpression
- inequalityMethod("eq")
Returns
- sql.a.gt("b") //=> a > "b"
patio.sql.BooleanExpression
- inequalityMethod("gt")
Returns
- sql.a.gte("b") //=> a >= "b"
patio.sql.BooleanExpression
- inequalityMethod("gte")
Returns
- sql.a.lt("b") //=> a < "b"
patio.sql.BooleanExpression
- inequalityMethod("lt")
Returns
- sql.a.lte("b") //=> a <= "b"
patio.sql.BooleanExpression
- inequalityMethod("lte")