From d96011dc19ffbcc7d562b003856e34fd3120f4c8 Mon Sep 17 00:00:00 2001 From: joselcvarela Date: Wed, 28 Nov 2018 08:44:46 +0000 Subject: [PATCH] Add or_raw statement --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 8f38ed9..029fc1d 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,9 @@ var functionOperatorMap = { AND_ISNULL: 'andWhereNull', AND_NOTNULL: 'andWhereNotNull', /* ---- */ - RAW: 'whereRaw' + RAW: 'whereRaw', + OR_RAW: 'orWhereRaw', + AND_RAW: 'whereRaw', }; var aliases = { @@ -64,7 +66,7 @@ function addCondition (q, field, val) { val = [ 'AND', field ].concat(val); } } - var args = val[0] === 'RAW' ? [ '"'+val[1]+'" ' + val[2] ] : val.slice(1) + var args = val[0].includes('RAW') ? [ '"'+val[1]+'" ' + val[2] ] : val.slice(1) return q[functionOperatorMap[val[0]]].apply(q, args); }