Browse Source

fix: case-insensitive filter in postgres

re #873

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/921/head
Pranav C 3 years ago
parent
commit
4c80c32195
  1. 6
      packages/nocodb/src/lib/dataMapper/lib/sql/CustomKnex.ts

6
packages/nocodb/src/lib/dataMapper/lib/sql/CustomKnex.ts

@ -6,7 +6,7 @@ types.setTypeParser(1082, val => val);
import { BaseModelSql } from './BaseModelSql';
const opMapping = {
const opMappingGen = {
eq: '=',
lt: '<',
gt: '>',
@ -92,6 +92,10 @@ const appendWhereCondition = function(
knexRef,
isHaving = false
) {
const opMapping = {
...opMappingGen,
...(knexRef?.client?.config?.client === 'pg' ? { like: 'ilike' } : {})
};
const camKey = isHaving ? 'Having' : 'Where';
const key = isHaving ? 'having' : 'where';

Loading…
Cancel
Save