Browse Source

fix: postgres not like filter query correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4885/head
Pranav C 2 years ago
parent
commit
505dbcb1db
  1. 10
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

10
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

@ -303,11 +303,11 @@ const parseConditionV2 = async (
} else {
val = val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`;
}
qb = qb.whereNot(
field,
qb?.client?.config?.client === 'pg' ? 'ilike' : 'like',
val
);
if (qb?.client?.config?.client === 'pg') {
qb = qb.whereRaw('??::text not ilike ?', [field, val]);
} else {
qb = qb.whereNot(field, 'like', val);
}
break;
case 'allof':
case 'anyof':

Loading…
Cancel
Save