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 { } else {
val = val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`; val = val.startsWith('%') || val.endsWith('%') ? val : `%${val}%`;
} }
qb = qb.whereNot( if (qb?.client?.config?.client === 'pg') {
field, qb = qb.whereRaw('??::text not ilike ?', [field, val]);
qb?.client?.config?.client === 'pg' ? 'ilike' : 'like', } else {
val qb = qb.whereNot(field, 'like', val);
); }
break; break;
case 'allof': case 'allof':
case 'anyof': case 'anyof':

Loading…
Cancel
Save