Comparing version 0.1.6 to 0.1.7
exports.between = function (a, b) { | ||
return createSpecialObject({ from: a, to: b }, 'between'); | ||
}; | ||
exports.not_between = function (a, b) { | ||
return createSpecialObject({ from: a, to: b }, 'not_between'); | ||
}; | ||
exports.like = function (expr) { | ||
@@ -5,0 +8,0 @@ return createSpecialObject({ expr: expr }, 'like'); |
@@ -90,2 +90,11 @@ exports.build = function (Dialect, where) { | ||
break; | ||
case "not_between": | ||
query.push( | ||
buildComparisonKey(Dialect, where.t, k) + | ||
" NOT BETWEEN " + | ||
Dialect.escapeVal(where.w[k].from) + | ||
" AND " + | ||
Dialect.escapeVal(where.w[k].to) | ||
); | ||
break; | ||
case "like": | ||
@@ -92,0 +101,0 @@ query.push( |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"license": "MIT", | ||
@@ -12,0 +12,0 @@ "repository": { |
@@ -144,2 +144,7 @@ var common = require('../common'); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: common.Query.not_between('a', 'b') }).build(), | ||
"SELECT * FROM `table1` WHERE `col` NOT BETWEEN 'a' AND 'b'" | ||
); | ||
assert.equal( | ||
common.Select().from('table1').where({ col: common.Query.like('abc') }).build(), | ||
@@ -146,0 +151,0 @@ "SELECT * FROM `table1` WHERE `col` LIKE 'abc'" |
44323
1482