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. 14
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/conditionV2.ts

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

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

Loading…
Cancel
Save