Allow for IN, NOT IN, and != queries in postgres
This commit is contained in:
parent
6d33aaaa48
commit
c3dd47f448
|
@ -243,8 +243,17 @@ PG.prototype.toFilter = function (model, filter) {
|
|||
case 'between':
|
||||
sqlCond += ' BETWEEN ';
|
||||
break;
|
||||
case 'inq':
|
||||
sqlCond += ' IN ';
|
||||
break;
|
||||
case 'nin':
|
||||
sqlCond += ' NOT IN ';
|
||||
break;
|
||||
case 'neq':
|
||||
sqlCond += ' != ';
|
||||
break;
|
||||
}
|
||||
sqlCond += filterValue;
|
||||
sqlCond += (condType == 'inq' || condType == 'nin') ? '(' + filterValue + ')' : filterValue;
|
||||
fields.push(sqlCond);
|
||||
} else {
|
||||
fields.push('"' + key + '" = ' + filterValue);
|
||||
|
|
Loading…
Reference in New Issue