mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 07:16:00 +00:00
structured filter type => filterBehaviour
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
import P from 'parsimmon';
|
import P from 'parsimmon';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { FilterType } from './types';
|
|
||||||
import { Condition } from 'dbgate-sqltree';
|
|
||||||
import type { TransformType } from 'dbgate-types';
|
import type { TransformType } from 'dbgate-types';
|
||||||
import { interpretEscapes, token, word, whitespace } from './common';
|
import { token, word, whitespace } from './common';
|
||||||
|
|
||||||
const compoudCondition = conditionType => conditions => {
|
const compoudCondition = conditionType => conditions => {
|
||||||
if (conditions.length == 1) return conditions[0];
|
if (conditions.length == 1) return conditions[0];
|
||||||
|
|||||||
12
packages/filterparser/src/detectSqlFilterBehaviour.ts
Normal file
12
packages/filterparser/src/detectSqlFilterBehaviour.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { isTypeNumber, isTypeString, isTypeLogical, isTypeDateTime } from 'dbgate-tools';
|
||||||
|
import { FilterBehaviour } from 'dbgate-types';
|
||||||
|
import { DatetimeFilterBehaviour, LogicalFilterBehaviour, NumberFilterBehaviour, StringFilterBehaviour } from './filterTypes';
|
||||||
|
|
||||||
|
export function detectSqlFilterType(dataType: string): FilterBehaviour {
|
||||||
|
if (!dataType) return StringFilterBehaviour;
|
||||||
|
if (isTypeNumber(dataType)) return NumberFilterBehaviour;
|
||||||
|
if (isTypeString(dataType)) return StringFilterBehaviour;
|
||||||
|
if (isTypeLogical(dataType)) return LogicalFilterBehaviour;
|
||||||
|
if (isTypeDateTime(dataType)) return DatetimeFilterBehaviour;
|
||||||
|
return StringFilterBehaviour;
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { isTypeNumber, isTypeString, isTypeLogical, isTypeDateTime } from 'dbgate-tools';
|
|
||||||
import { StructuredFilterType } from 'dbgate-types';
|
|
||||||
import { DatetimeFilterType, LogicalFilterType, NumberFilterType, StringFilterType } from './filterTypes';
|
|
||||||
|
|
||||||
export function detectSqlFilterType(dataType: string): StructuredFilterType {
|
|
||||||
if (!dataType) return StringFilterType;
|
|
||||||
if (isTypeNumber(dataType)) return NumberFilterType;
|
|
||||||
if (isTypeString(dataType)) return StringFilterType;
|
|
||||||
if (isTypeLogical(dataType)) return LogicalFilterType;
|
|
||||||
if (isTypeDateTime(dataType)) return DatetimeFilterType;
|
|
||||||
return StringFilterType;
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { StructuredFilterType } from 'dbgate-types';
|
import { FilterBehaviour } from 'dbgate-types';
|
||||||
|
|
||||||
export const NumberFilterType: StructuredFilterType = {
|
export const NumberFilterBehaviour: FilterBehaviour = {
|
||||||
compilerType: 'sqlTree',
|
compilerType: 'sqlTree',
|
||||||
supportEquals: true,
|
supportEquals: true,
|
||||||
supportNumberLikeComparison: true,
|
supportNumberLikeComparison: true,
|
||||||
@@ -10,7 +10,7 @@ export const NumberFilterType: StructuredFilterType = {
|
|||||||
allowNumberToken: true,
|
allowNumberToken: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const StringFilterType: StructuredFilterType = {
|
export const StringFilterBehaviour: FilterBehaviour = {
|
||||||
compilerType: 'sqlTree',
|
compilerType: 'sqlTree',
|
||||||
supportEquals: true,
|
supportEquals: true,
|
||||||
supportStringInclusion: true,
|
supportStringInclusion: true,
|
||||||
@@ -23,14 +23,14 @@ export const StringFilterType: StructuredFilterType = {
|
|||||||
allowHexString: true,
|
allowHexString: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LogicalFilterType: StructuredFilterType = {
|
export const LogicalFilterBehaviour: FilterBehaviour = {
|
||||||
compilerType: 'sqlTree',
|
compilerType: 'sqlTree',
|
||||||
supportBooleanValues: true,
|
supportBooleanValues: true,
|
||||||
supportNullTesting: true,
|
supportNullTesting: true,
|
||||||
supportSqlCondition: true,
|
supportSqlCondition: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const DatetimeFilterType: StructuredFilterType = {
|
export const DatetimeFilterBehaviour: FilterBehaviour = {
|
||||||
compilerType: 'sqlTree',
|
compilerType: 'sqlTree',
|
||||||
supportNullTesting: true,
|
supportNullTesting: true,
|
||||||
supportSqlCondition: true,
|
supportSqlCondition: true,
|
||||||
@@ -38,7 +38,7 @@ export const DatetimeFilterType: StructuredFilterType = {
|
|||||||
supportDatetimeComparison: true,
|
supportDatetimeComparison: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MongoFilterType: StructuredFilterType = {
|
export const MongoFilterBehaviour: FilterBehaviour = {
|
||||||
compilerType: 'mongoCondition',
|
compilerType: 'mongoCondition',
|
||||||
supportEquals: true,
|
supportEquals: true,
|
||||||
supportArrayTesting: true,
|
supportArrayTesting: true,
|
||||||
@@ -48,7 +48,7 @@ export const MongoFilterType: StructuredFilterType = {
|
|||||||
supportExistsTesting: true,
|
supportExistsTesting: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EvalFilterType: StructuredFilterType = {
|
export const EvalFilterBehaviour: FilterBehaviour = {
|
||||||
compilerType: 'sqlTree',
|
compilerType: 'sqlTree',
|
||||||
supportEquals: true,
|
supportEquals: true,
|
||||||
supportStringInclusion: true,
|
supportStringInclusion: true,
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export * from './parseFilter';
|
export * from './parseFilter';
|
||||||
export * from './detectSqlFilterType';
|
export * from './detectSqlFilterBehaviour';
|
||||||
export * from './filterTool';
|
export * from './filterTool';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { interpretEscapes, token, word, whitespace } from './common';
|
|||||||
import { mongoParser } from './mongoParser';
|
import { mongoParser } from './mongoParser';
|
||||||
import { datetimeParser } from './datetimeParser';
|
import { datetimeParser } from './datetimeParser';
|
||||||
import { hexStringToArray } from 'dbgate-tools';
|
import { hexStringToArray } from 'dbgate-tools';
|
||||||
import { StructuredFilterType } from 'dbgate-types';
|
import { FilterBehaviour } from 'dbgate-types';
|
||||||
|
|
||||||
const binaryCondition = operator => value => ({
|
const binaryCondition = operator => value => ({
|
||||||
conditionType: 'binary',
|
conditionType: 'binary',
|
||||||
@@ -77,7 +77,7 @@ const sqlTemplate = templateSql => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const createParser = (structuredFilterType: StructuredFilterType) => {
|
const createParser = (filterBehaviour: FilterBehaviour) => {
|
||||||
const langDef = {
|
const langDef = {
|
||||||
string1: () =>
|
string1: () =>
|
||||||
token(P.regexp(/"((?:\\.|.)*?)"/, 1))
|
token(P.regexp(/"((?:\\.|.)*?)"/, 1))
|
||||||
@@ -155,44 +155,44 @@ const createParser = (structuredFilterType: StructuredFilterType) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const allowedValues = []; // 'string1', 'string2', 'number', 'noQuotedString'];
|
const allowedValues = []; // 'string1', 'string2', 'number', 'noQuotedString'];
|
||||||
if (structuredFilterType.allowStringToken) {
|
if (filterBehaviour.allowStringToken) {
|
||||||
allowedValues.push('string1', 'string2', 'noQuotedString');
|
allowedValues.push('string1', 'string2', 'noQuotedString');
|
||||||
}
|
}
|
||||||
if (structuredFilterType.allowNumberToken) {
|
if (filterBehaviour.allowNumberToken) {
|
||||||
allowedValues.push('string1Num', 'string2Num', 'number');
|
allowedValues.push('string1Num', 'string2Num', 'number');
|
||||||
}
|
}
|
||||||
|
|
||||||
const allowedElements = [];
|
const allowedElements = [];
|
||||||
|
|
||||||
if (structuredFilterType.supportNullTesting) {
|
if (filterBehaviour.supportNullTesting) {
|
||||||
allowedElements.push('null', 'notNull');
|
allowedElements.push('null', 'notNull');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportEquals) {
|
if (filterBehaviour.supportEquals) {
|
||||||
allowedElements.push('eq', 'ne', 'ne2');
|
allowedElements.push('eq', 'ne', 'ne2');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportSqlCondition) {
|
if (filterBehaviour.supportSqlCondition) {
|
||||||
allowedElements.push('sql');
|
allowedElements.push('sql');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportNumberLikeComparison || structuredFilterType.supportDatetimeComparison) {
|
if (filterBehaviour.supportNumberLikeComparison || filterBehaviour.supportDatetimeComparison) {
|
||||||
allowedElements.push('le', 'ge', 'lt', 'gt');
|
allowedElements.push('le', 'ge', 'lt', 'gt');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportEmpty) {
|
if (filterBehaviour.supportEmpty) {
|
||||||
allowedElements.push('empty', 'notEmpty');
|
allowedElements.push('empty', 'notEmpty');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.allowHexString) {
|
if (filterBehaviour.allowHexString) {
|
||||||
allowedElements.push('hexTestEq');
|
allowedElements.push('hexTestEq');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportStringInclusion) {
|
if (filterBehaviour.supportStringInclusion) {
|
||||||
allowedElements.push('startsWith', 'endsWith', 'contains', 'startsWithNot', 'endsWithNot', 'containsNot');
|
allowedElements.push('startsWith', 'endsWith', 'contains', 'startsWithNot', 'endsWithNot', 'containsNot');
|
||||||
}
|
}
|
||||||
if (structuredFilterType.supportBooleanValues) {
|
if (filterBehaviour.supportBooleanValues) {
|
||||||
if (structuredFilterType.allowNumberToken || structuredFilterType.allowStringToken) {
|
if (filterBehaviour.allowNumberToken || filterBehaviour.allowStringToken) {
|
||||||
allowedElements.push('true', 'false');
|
allowedElements.push('true', 'false');
|
||||||
} else {
|
} else {
|
||||||
allowedElements.push('true', 'false', 'trueNum', 'falseNum');
|
allowedElements.push('true', 'false', 'trueNum', 'falseNum');
|
||||||
@@ -200,7 +200,7 @@ const createParser = (structuredFilterType: StructuredFilterType) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// must be last
|
// must be last
|
||||||
if (structuredFilterType.allowStringToken) {
|
if (filterBehaviour.allowStringToken) {
|
||||||
allowedElements.push('valueTestStr');
|
allowedElements.push('valueTestStr');
|
||||||
} else {
|
} else {
|
||||||
allowedElements.push('valueTestEq');
|
allowedElements.push('valueTestEq');
|
||||||
@@ -211,22 +211,22 @@ const createParser = (structuredFilterType: StructuredFilterType) => {
|
|||||||
|
|
||||||
const cachedFilters: { [key: string]: P.Language } = {};
|
const cachedFilters: { [key: string]: P.Language } = {};
|
||||||
|
|
||||||
function getParser(structuredFilterType: StructuredFilterType) {
|
function getParser(filterBehaviour: FilterBehaviour) {
|
||||||
if (structuredFilterType.compilerType == 'mongoCondition') {
|
if (filterBehaviour.compilerType == 'mongoCondition') {
|
||||||
return mongoParser;
|
return mongoParser;
|
||||||
}
|
}
|
||||||
if (structuredFilterType.compilerType == 'datetime') {
|
if (filterBehaviour.compilerType == 'datetime') {
|
||||||
return datetimeParser;
|
return datetimeParser;
|
||||||
}
|
}
|
||||||
const key = JSON.stringify(structuredFilterType);
|
const key = JSON.stringify(filterBehaviour);
|
||||||
if (!cachedFilters[key]) {
|
if (!cachedFilters[key]) {
|
||||||
cachedFilters[key] = createParser(structuredFilterType);
|
cachedFilters[key] = createParser(filterBehaviour);
|
||||||
}
|
}
|
||||||
return cachedFilters[key];
|
return cachedFilters[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
export function parseFilter(value: string, structuredFilterType: StructuredFilterType): Condition {
|
export function parseFilter(value: string, filterBehaviour: FilterBehaviour): Condition {
|
||||||
const parser = getParser(structuredFilterType);
|
const parser = getParser(filterBehaviour);
|
||||||
const ast = parser.list.tryParse(value);
|
const ast = parser.list.tryParse(value);
|
||||||
// console.log('AST', ast);
|
// console.log('AST', ast);
|
||||||
return ast;
|
return ast;
|
||||||
|
|||||||
4
packages/types/engines.d.ts
vendored
4
packages/types/engines.d.ts
vendored
@@ -3,7 +3,7 @@ import { QueryResult } from './query';
|
|||||||
import { SqlDialect } from './dialect';
|
import { SqlDialect } from './dialect';
|
||||||
import { SqlDumper } from './dumper';
|
import { SqlDumper } from './dumper';
|
||||||
import { DatabaseInfo, NamedObjectInfo, TableInfo, ViewInfo, ProcedureInfo, FunctionInfo, TriggerInfo } from './dbinfo';
|
import { DatabaseInfo, NamedObjectInfo, TableInfo, ViewInfo, ProcedureInfo, FunctionInfo, TriggerInfo } from './dbinfo';
|
||||||
import { StructuredFilterType } from './filter-type';
|
import { FilterBehaviour } from './filter-type';
|
||||||
|
|
||||||
export interface StreamOptions {
|
export interface StreamOptions {
|
||||||
recordset: (columns) => void;
|
recordset: (columns) => void;
|
||||||
@@ -154,7 +154,7 @@ export interface EngineDriver {
|
|||||||
getRedirectAuthUrl(connection, options): Promise<{ url: string; sid: string }>;
|
getRedirectAuthUrl(connection, options): Promise<{ url: string; sid: string }>;
|
||||||
getAuthTokenFromCode(connection, options): Promise<string>;
|
getAuthTokenFromCode(connection, options): Promise<string>;
|
||||||
getAccessTokenFromAuth(connection, req): Promise<string | null>;
|
getAccessTokenFromAuth(connection, req): Promise<string | null>;
|
||||||
getFilterType(dataType: string): StructuredFilterType;
|
getFilterType(dataType: string): FilterBehaviour;
|
||||||
|
|
||||||
analyserClass?: any;
|
analyserClass?: any;
|
||||||
dumperClass?: any;
|
dumperClass?: any;
|
||||||
|
|||||||
2
packages/types/filter-type.d.ts
vendored
2
packages/types/filter-type.d.ts
vendored
@@ -1,6 +1,6 @@
|
|||||||
export type FilterParserCompilerType = 'sqlTree' | 'mongoCondition' | 'datetime';
|
export type FilterParserCompilerType = 'sqlTree' | 'mongoCondition' | 'datetime';
|
||||||
|
|
||||||
export interface StructuredFilterType {
|
export interface FilterBehaviour {
|
||||||
compilerType: FilterParserCompilerType;
|
compilerType: FilterParserCompilerType;
|
||||||
|
|
||||||
supportEquals?: boolean;
|
supportEquals?: boolean;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
export let isReadOnly = false;
|
export let isReadOnly = false;
|
||||||
export let filterType;
|
export let filterType;
|
||||||
export let structuredFilterType;
|
export let filterBehaviour;
|
||||||
export let filter;
|
export let filter;
|
||||||
export let setFilter;
|
export let setFilter;
|
||||||
export let showResizeSplitter = false;
|
export let showResizeSplitter = false;
|
||||||
@@ -66,35 +66,35 @@
|
|||||||
{ onClick: () => filterMultipleValues(), text: 'Filter multiple values' },
|
{ onClick: () => filterMultipleValues(), text: 'Filter multiple values' },
|
||||||
];
|
];
|
||||||
|
|
||||||
if (structuredFilterType.supportEquals) {
|
if (filterBehaviour.supportEquals) {
|
||||||
res.push(
|
res.push(
|
||||||
{ onClick: () => openFilterWindow('='), text: 'Equals...' },
|
{ onClick: () => openFilterWindow('='), text: 'Equals...' },
|
||||||
{ onClick: () => openFilterWindow('<>'), text: 'Does Not Equal...' }
|
{ onClick: () => openFilterWindow('<>'), text: 'Does Not Equal...' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportExistsTesting) {
|
if (filterBehaviour.supportExistsTesting) {
|
||||||
res.push(
|
res.push(
|
||||||
{ onClick: () => setFilter('EXISTS'), text: 'Field exists' },
|
{ onClick: () => setFilter('EXISTS'), text: 'Field exists' },
|
||||||
{ onClick: () => setFilter('NOT EXISTS'), text: 'Field does not exist' }
|
{ onClick: () => setFilter('NOT EXISTS'), text: 'Field does not exist' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportArrayTesting) {
|
if (filterBehaviour.supportArrayTesting) {
|
||||||
res.push(
|
res.push(
|
||||||
{ onClick: () => setFilter('NOT EMPTY ARRAY'), text: 'Array is not empty' },
|
{ onClick: () => setFilter('NOT EMPTY ARRAY'), text: 'Array is not empty' },
|
||||||
{ onClick: () => setFilter('EMPTY ARRAY'), text: 'Array is empty' }
|
{ onClick: () => setFilter('EMPTY ARRAY'), text: 'Array is empty' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportNullTesting) {
|
if (filterBehaviour.supportNullTesting) {
|
||||||
res.push(
|
res.push(
|
||||||
{ onClick: () => setFilter('NULL'), text: 'Is Null' },
|
{ onClick: () => setFilter('NULL'), text: 'Is Null' },
|
||||||
{ onClick: () => setFilter('NOT NULL'), text: 'Is Not Null' }
|
{ onClick: () => setFilter('NOT NULL'), text: 'Is Not Null' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportNumberLikeComparison) {
|
if (filterBehaviour.supportNumberLikeComparison) {
|
||||||
res.push(
|
res.push(
|
||||||
{ onClick: () => openFilterWindow('>'), text: 'Greater Than...' },
|
{ onClick: () => openFilterWindow('>'), text: 'Greater Than...' },
|
||||||
{ onClick: () => openFilterWindow('>='), text: 'Greater Than Or Equal To...' },
|
{ onClick: () => openFilterWindow('>='), text: 'Greater Than Or Equal To...' },
|
||||||
@@ -103,7 +103,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportStringInclusion) {
|
if (filterBehaviour.supportStringInclusion) {
|
||||||
res.push(
|
res.push(
|
||||||
{ divider: true },
|
{ divider: true },
|
||||||
|
|
||||||
@@ -116,21 +116,21 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportBooleanValues) {
|
if (filterBehaviour.supportBooleanValues) {
|
||||||
res.push(
|
res.push(
|
||||||
{ onClick: () => setFilter('TRUE'), text: 'Is True' },
|
{ onClick: () => setFilter('TRUE'), text: 'Is True' },
|
||||||
{ onClick: () => setFilter('FALSE'), text: 'Is False' }
|
{ onClick: () => setFilter('FALSE'), text: 'Is False' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportBooleanValues && structuredFilterType.supportNullTesting) {
|
if (filterBehaviour.supportBooleanValues && filterBehaviour.supportNullTesting) {
|
||||||
res.push(
|
res.push(
|
||||||
{ onClick: () => setFilter('TRUE, NULL'), text: 'Is True or NULL' },
|
{ onClick: () => setFilter('TRUE, NULL'), text: 'Is True or NULL' },
|
||||||
{ onClick: () => setFilter('FALSE, NULL'), text: 'Is False or NULL' }
|
{ onClick: () => setFilter('FALSE, NULL'), text: 'Is False or NULL' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportDatetimeSymbols) {
|
if (filterBehaviour.supportDatetimeSymbols) {
|
||||||
res.push(
|
res.push(
|
||||||
{ divider: true },
|
{ divider: true },
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportDatetimeComparison) {
|
if (filterBehaviour.supportDatetimeComparison) {
|
||||||
res.push(
|
res.push(
|
||||||
{ divider: true },
|
{ divider: true },
|
||||||
{ onClick: () => openFilterWindow('<='), text: 'Before...' },
|
{ onClick: () => openFilterWindow('<='), text: 'Before...' },
|
||||||
@@ -167,7 +167,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportSqlCondition) {
|
if (filterBehaviour.supportSqlCondition) {
|
||||||
res.push(
|
res.push(
|
||||||
{ divider: true },
|
{ divider: true },
|
||||||
{ onClick: () => openFilterWindow('sql'), text: 'SQL condition ...' },
|
{ onClick: () => openFilterWindow('sql'), text: 'SQL condition ...' },
|
||||||
|
|||||||
@@ -3,15 +3,15 @@
|
|||||||
|
|
||||||
export let name;
|
export let name;
|
||||||
export let filterType;
|
export let filterType;
|
||||||
export let structuredFilterType;
|
export let filterBehaviour;
|
||||||
|
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
const res = [];
|
const res = [];
|
||||||
if (structuredFilterType.supportEquals) {
|
if (filterBehaviour.supportEquals) {
|
||||||
res.push({ value: '=', label: 'equals' }, { value: '<>', label: 'does not equal' });
|
res.push({ value: '=', label: 'equals' }, { value: '<>', label: 'does not equal' });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportStringInclusion) {
|
if (filterBehaviour.supportStringInclusion) {
|
||||||
res.push(
|
res.push(
|
||||||
{ value: '+', label: 'contains' },
|
{ value: '+', label: 'contains' },
|
||||||
{ value: '~', label: 'does not contain' },
|
{ value: '~', label: 'does not contain' },
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportNumberLikeComparison) {
|
if (filterBehaviour.supportNumberLikeComparison) {
|
||||||
res.push(
|
res.push(
|
||||||
{ value: '<', label: 'is smaller' },
|
{ value: '<', label: 'is smaller' },
|
||||||
{ value: '>', label: 'is greater' },
|
{ value: '>', label: 'is greater' },
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportDatetimeComparison) {
|
if (filterBehaviour.supportDatetimeComparison) {
|
||||||
res.push(
|
res.push(
|
||||||
{ value: '<', label: 'is before' },
|
{ value: '<', label: 'is before' },
|
||||||
{ value: '>', label: 'is after' },
|
{ value: '>', label: 'is after' },
|
||||||
@@ -40,15 +40,15 @@
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportNullTesting) {
|
if (filterBehaviour.supportNullTesting) {
|
||||||
res.push({ value: 'NULL', label: 'is NULL' }, { value: 'NOT NULL', label: 'is not NULL' });
|
res.push({ value: 'NULL', label: 'is NULL' }, { value: 'NOT NULL', label: 'is not NULL' });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportExistsTesting) {
|
if (filterBehaviour.supportExistsTesting) {
|
||||||
res.push({ value: 'EXISTS', label: 'field exists' }, { value: 'NOT EXISTS', label: 'field does not exist' });
|
res.push({ value: 'EXISTS', label: 'field exists' }, { value: 'NOT EXISTS', label: 'field does not exist' });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (structuredFilterType.supportSqlCondition) {
|
if (filterBehaviour.supportSqlCondition) {
|
||||||
res.push(
|
res.push(
|
||||||
{ value: 'sql', label: 'SQL condition' },
|
{ value: 'sql', label: 'SQL condition' },
|
||||||
{ value: 'sqlRight', label: 'SQL condition - right side only' }
|
{ value: 'sqlRight', label: 'SQL condition - right side only' }
|
||||||
|
|||||||
Reference in New Issue
Block a user