mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-22 07:36:01 +00:00
sql condition in filter dialog #369
This commit is contained in:
@@ -70,6 +70,11 @@
|
||||
{ onClick: () => openFilterWindow('>='), text: 'Greater Than Or Equal To...' },
|
||||
{ onClick: () => openFilterWindow('<'), text: 'Less Than...' },
|
||||
{ onClick: () => openFilterWindow('<='), text: 'Less Than Or Equal To...' },
|
||||
|
||||
{ divider: true },
|
||||
|
||||
{ onClick: () => openFilterWindow('sql'), text: 'SQL condition ...' },
|
||||
{ onClick: () => openFilterWindow('sqlRight'), text: 'SQL condition - right side ...' },
|
||||
];
|
||||
case 'logical':
|
||||
return [
|
||||
@@ -81,6 +86,11 @@
|
||||
{ onClick: () => setFilter('FALSE'), text: 'Is False' },
|
||||
{ onClick: () => setFilter('TRUE, NULL'), text: 'Is True or NULL' },
|
||||
{ onClick: () => setFilter('FALSE, NULL'), text: 'Is False or NULL' },
|
||||
|
||||
{ divider: true },
|
||||
|
||||
{ onClick: () => openFilterWindow('sql'), text: 'SQL condition ...' },
|
||||
{ onClick: () => openFilterWindow('sqlRight'), text: 'SQL condition - right side ...' },
|
||||
];
|
||||
case 'datetime':
|
||||
return [
|
||||
@@ -120,6 +130,9 @@
|
||||
{ onClick: () => setFilter('LAST YEAR'), text: 'Last Year' },
|
||||
|
||||
{ divider: true },
|
||||
|
||||
{ onClick: () => openFilterWindow('sql'), text: 'SQL condition ...' },
|
||||
{ onClick: () => openFilterWindow('sqlRight'), text: 'SQL condition - right side ...' },
|
||||
];
|
||||
case 'string':
|
||||
return [
|
||||
@@ -141,6 +154,11 @@
|
||||
{ onClick: () => openFilterWindow('!^'), text: 'Does Not Begin With...' },
|
||||
{ onClick: () => openFilterWindow('$'), text: 'Ends With...' },
|
||||
{ onClick: () => openFilterWindow('!$'), text: 'Does Not End With...' },
|
||||
|
||||
{ divider: true },
|
||||
|
||||
{ onClick: () => openFilterWindow('sql'), text: 'SQL condition ...' },
|
||||
{ onClick: () => openFilterWindow('sqlRight'), text: 'SQL condition - right side ...' },
|
||||
];
|
||||
case 'mongo':
|
||||
return [
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
const createTerm = (condition, value) => {
|
||||
if (!hasOperand(condition)) return condition;
|
||||
if (!value) return null;
|
||||
if (condition == 'sql') return `{${value}}`;
|
||||
if (condition == 'sqlRight') return `{$$ ${value}}`;
|
||||
if (filterType == 'string') return `${condition}"${value}"`;
|
||||
return `${condition}${value}`;
|
||||
};
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
{ value: '>=', label: 'is greater or equal' },
|
||||
{ value: 'NULL', label: 'is NULL' },
|
||||
{ value: 'NOT NULL', label: 'is not NULL' },
|
||||
{ value: 'sql', label: 'SQL condition' },
|
||||
{ value: 'sqlRight', label: 'SQL condition - right side only' },
|
||||
];
|
||||
case 'string':
|
||||
return [
|
||||
@@ -33,6 +35,8 @@
|
||||
{ value: '>=', label: 'is greater or equal' },
|
||||
{ value: 'NULL', label: 'is NULL' },
|
||||
{ value: 'NOT NULL', label: 'is not NULL' },
|
||||
{ value: 'sql', label: 'SQL condition' },
|
||||
{ value: 'sqlRight', label: 'SQL condition - right side only' },
|
||||
];
|
||||
case 'datetime':
|
||||
return [
|
||||
@@ -44,6 +48,8 @@
|
||||
{ value: '>=', label: 'is after or equal' },
|
||||
{ value: 'NULL', label: 'is NULL' },
|
||||
{ value: 'NOT NULL', label: 'is not NULL' },
|
||||
{ value: 'sql', label: 'SQL condition' },
|
||||
{ value: 'sqlRight', label: 'SQL condition - right side only' },
|
||||
];
|
||||
case 'mongo':
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user