Browse Source

fix: pg cast type for like condition (#2531)

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/2568/head
mertmit 2 years ago committed by GitHub
parent
commit
ea0a2c0271
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

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

@ -286,11 +286,15 @@ const parseConditionV2 = async (
} else { } else {
val = `%${val}%`; val = `%${val}%`;
} }
if (qb?.client?.config?.client === 'pg') {
qb = qb.whereRaw('??::text ilike ?', [field, val]);
} else {
qb = qb.where( qb = qb.where(
field, field,
qb?.client?.config?.client === 'pg' ? 'ilike' : 'like', 'like',
val val
); );
}
break; break;
case 'nlike': case 'nlike':
if (column.uidt === UITypes.Formula) { if (column.uidt === UITypes.Formula) {

Loading…
Cancel
Save