|
|
@ -9,7 +9,6 @@ import RollupColumn from '../../../../models/RollupColumn'; |
|
|
|
import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; |
|
|
|
import formulaQueryBuilderv2 from './formulav2/formulaQueryBuilderv2'; |
|
|
|
import FormulaColumn from '../../../../models/FormulaColumn'; |
|
|
|
import FormulaColumn from '../../../../models/FormulaColumn'; |
|
|
|
import { RelationTypes, UITypes } from 'nocodb-sdk'; |
|
|
|
import { RelationTypes, UITypes } from 'nocodb-sdk'; |
|
|
|
// import LookupColumn from '../../../models/LookupColumn';
|
|
|
|
|
|
|
|
import { sanitize } from './helpers/sanitize'; |
|
|
|
import { sanitize } from './helpers/sanitize'; |
|
|
|
|
|
|
|
|
|
|
|
export default async function conditionV2( |
|
|
|
export default async function conditionV2( |
|
|
@ -368,6 +367,10 @@ const parseConditionV2 = async ( |
|
|
|
qb = qb.where(customWhereClause || field, ''); |
|
|
|
qb = qb.where(customWhereClause || field, ''); |
|
|
|
else if (filter.value === 'notempty') |
|
|
|
else if (filter.value === 'notempty') |
|
|
|
qb = qb.whereNot(customWhereClause || field, ''); |
|
|
|
qb = qb.whereNot(customWhereClause || field, ''); |
|
|
|
|
|
|
|
else if (filter.value === 'true') |
|
|
|
|
|
|
|
qb = qb.where(customWhereClause || field, true); |
|
|
|
|
|
|
|
else if (filter.value === 'false') |
|
|
|
|
|
|
|
qb = qb.where(customWhereClause || field, false); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'isnot': |
|
|
|
case 'isnot': |
|
|
|
if (filter.value === 'null') |
|
|
|
if (filter.value === 'null') |
|
|
@ -378,6 +381,10 @@ const parseConditionV2 = async ( |
|
|
|
qb = qb.whereNot(customWhereClause || field, ''); |
|
|
|
qb = qb.whereNot(customWhereClause || field, ''); |
|
|
|
else if (filter.value === 'notempty') |
|
|
|
else if (filter.value === 'notempty') |
|
|
|
qb = qb.where(customWhereClause || field, ''); |
|
|
|
qb = qb.where(customWhereClause || field, ''); |
|
|
|
|
|
|
|
else if (filter.value === 'true') |
|
|
|
|
|
|
|
qb = qb.whereNot(customWhereClause || field, true); |
|
|
|
|
|
|
|
else if (filter.value === 'false') |
|
|
|
|
|
|
|
qb = qb.whereNot(customWhereClause || field, false); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 'lt': |
|
|
|
case 'lt': |
|
|
|
qb = qb.where(field, customWhereClause ? '>' : '<', val); |
|
|
|
qb = qb.where(field, customWhereClause ? '>' : '<', val); |
|
|
@ -405,6 +412,16 @@ const parseConditionV2 = async ( |
|
|
|
case 'notnull': |
|
|
|
case 'notnull': |
|
|
|
qb = qb.whereNotNull(customWhereClause || field); |
|
|
|
qb = qb.whereNotNull(customWhereClause || field); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'checked': |
|
|
|
|
|
|
|
qb = qb.where(customWhereClause || field, true); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'notchecked': |
|
|
|
|
|
|
|
qb = qb.where((grpdQb) => { |
|
|
|
|
|
|
|
grpdQb |
|
|
|
|
|
|
|
.whereNull(customWhereClause || field) |
|
|
|
|
|
|
|
.orWhere(customWhereClause || field, false); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
break; |
|
|
|
case 'btw': |
|
|
|
case 'btw': |
|
|
|
qb = qb.whereBetween(field, val.split(',')); |
|
|
|
qb = qb.whereBetween(field, val.split(',')); |
|
|
|
break; |
|
|
|
break; |
|
|
|