diff --git a/lib/postgres.js b/lib/postgres.js index 59a96c5..5e3711c 100644 --- a/lib/postgres.js +++ b/lib/postgres.js @@ -284,6 +284,10 @@ PG.prototype.toFilter = function (model, filter) { fields.push(condType == 'inq' ? 'FALSE' : 'TRUE'); return true; } + if(condType == 'any') { + fields.push(' ' + filterValue + ' = ANY("' + key + '")'); + return true; + } switch (condType) { case 'gt': sqlCond += ' > '; @@ -619,6 +623,12 @@ function datatype(p) { return 'timestamp'; case 'Boolean': return 'boolean'; + case 'Array': + if(p.array && p.array.name === 'Number') { + return 'integer[]'; + } else { + return 'varchar[]'; + } } };