From 8afa2842615bfa1980b9df4239decc65309c8ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=99=AF=E8=BF=9C?= Date: Fri, 21 Apr 2017 14:31:56 +0800 Subject: [PATCH 1/2] add "not like" pairs --- sequel/lib/criteriaProcessor.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/sequel/lib/criteriaProcessor.js b/sequel/lib/criteriaProcessor.js index c158ac3..0446eb9 100644 --- a/sequel/lib/criteriaProcessor.js +++ b/sequel/lib/criteriaProcessor.js @@ -758,6 +758,31 @@ CriteriaProcessor.prototype.prepareCriterion = function prepareCriterion(key, va } break; + + case 'not like': + + if(this.caseSensitive) { + comparator = 'INOT LIKE'; + } + else { + comparator = 'NOT LIKE'; + } + + // Override comparator with WL Next features + if(hop(self.wlNext, 'caseSensitive') && self.wlNext.caseSensitive) { + comparator = 'NOT LIKE'; + } + + if(this.parameterized) { + this.values.push(value); + str = comparator + ' ' + '$' + this.paramCount; + } + else { + // Note that wildcards are not escaped out of NOT like criterion intentionally + str = comparator + ' "' + utils.escapeString(value) + '"'; + } + + break; case 'contains': From 8b0277c5264f95eb88f856787afa4449071e5226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=99=AF=E8=BF=9C?= Date: Fri, 21 Apr 2017 16:13:10 +0800 Subject: [PATCH 2/2] v0.5.8 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8c16b1e..3cff877 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "waterline-sequel", "description": "A helper library for generating SQL queries from the Waterline Query Language.", - "version": "0.5.7", + "version": "0.5.8", "author": "Cody Stoltman ", "url": "http://github.com/balderdashy/waterline-sequel", "keywords": [],