From 527520aca2e487c6dc84f9e8d59d6f3ae940ee40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Haz=C4=B1m=20Dikenli?= Date: Mon, 8 Jan 2024 17:32:15 +0300 Subject: [PATCH] feat: add support for contained by operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hazım Dikenli --- lib/postgresql.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/postgresql.js b/lib/postgresql.js index 7771f8c7..7bb53fd8 100644 --- a/lib/postgresql.js +++ b/lib/postgresql.js @@ -554,6 +554,10 @@ PostgreSQL.prototype.buildExpression = function(columnName, operator, return new ParameterizedSQL(columnName + ' @> array[' + operatorValue.map(() => '?') + ']::' + propertyDefinition.postgresql.dataType, operatorValue); + case 'containedby': + return new ParameterizedSQL(columnName + ' <@ array[' + operatorValue.map(() => '?') + ']::' + + propertyDefinition.postgresql.dataType, + operatorValue); case 'match': return new ParameterizedSQL(`to_tsvector(${columnName}) @@ to_tsquery(?)`, [operatorValue]); default: