From cbf7eafb310c0ef61a389b66380b830452d23838 Mon Sep 17 00:00:00 2001 From: Shuai Yang Date: Mon, 11 Nov 2019 16:49:50 +0800 Subject: [PATCH] Add where not in support. --- js/builder.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/builder.js b/js/builder.js index cbbad87..a211f03 100644 --- a/js/builder.js +++ b/js/builder.js @@ -229,7 +229,9 @@ class Builder { } else { args.push(this.parseQualfiedIdFromLiteralValue(op.left)); - switch (op.operation) { + let operation = op.operation.toUpperCase(); + + switch (operation) { case '=': func_name = 'where'; args.push(op.right.value); @@ -253,7 +255,12 @@ class Builder { break; case 'IN': - func_name = 'whereIn'; + case 'NOT IN': + if (operation == 'IN') { + func_name = 'whereIn'; + } else { + func_name = 'whereNotIn'; + } if (op.right.constructor.name == 'SubSelect') { args.push(`function($query) {