mirror of
https://github.com/harish2704/knex-json-query.git
synced 2026-09-10 12:51:08 +00:00
Add or_raw statement
This commit is contained in:
@@ -26,7 +26,9 @@ var functionOperatorMap = {
|
|||||||
AND_ISNULL: 'andWhereNull',
|
AND_ISNULL: 'andWhereNull',
|
||||||
AND_NOTNULL: 'andWhereNotNull',
|
AND_NOTNULL: 'andWhereNotNull',
|
||||||
/* ---- */
|
/* ---- */
|
||||||
RAW: 'whereRaw'
|
RAW: 'whereRaw',
|
||||||
|
OR_RAW: 'orWhereRaw',
|
||||||
|
AND_RAW: 'whereRaw',
|
||||||
};
|
};
|
||||||
|
|
||||||
var aliases = {
|
var aliases = {
|
||||||
@@ -64,7 +66,7 @@ function addCondition (q, field, val) {
|
|||||||
val = [ 'AND', field ].concat(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);
|
return q[functionOperatorMap[val[0]]].apply(q, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user