@quillsql/react 2.13.43 → 2.13.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Chart.d.ts.map +1 -1
- package/dist/cjs/Chart.js +2 -2
- package/dist/cjs/ChartBuilder.d.ts +1 -0
- package/dist/cjs/ChartBuilder.d.ts.map +1 -1
- package/dist/cjs/ChartBuilder.js +48 -14
- package/dist/cjs/ChartEditor.d.ts +1 -1
- package/dist/cjs/ChartEditor.d.ts.map +1 -1
- package/dist/cjs/ChartEditor.js +2 -2
- package/dist/cjs/Context.d.ts.map +1 -1
- package/dist/cjs/Context.js +37 -26
- package/dist/cjs/Dashboard.d.ts +2 -2
- package/dist/cjs/Dashboard.d.ts.map +1 -1
- package/dist/cjs/Dashboard.js +115 -99
- package/dist/cjs/ReportBuilder.d.ts.map +1 -1
- package/dist/cjs/ReportBuilder.js +871 -1574
- package/dist/cjs/SQLEditor.d.ts.map +1 -1
- package/dist/cjs/SQLEditor.js +23 -4
- package/dist/cjs/Table.d.ts.map +1 -1
- package/dist/cjs/components/Chart/CustomReferenceLine.js +1 -1
- package/dist/cjs/components/Chart/GaugeChart.js +0 -6
- package/dist/cjs/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardFilter.js +3 -3
- package/dist/cjs/components/Dashboard/DashboardSection.d.ts +1 -1
- package/dist/cjs/components/Dashboard/DashboardSection.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/DashboardSection.js +20 -19
- package/dist/cjs/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/MetricComponent.js +1 -0
- package/dist/cjs/components/Dashboard/TableComponent.d.ts.map +1 -1
- package/dist/cjs/components/Dashboard/TableComponent.js +5 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/cjs/components/QuillMultiSelectWithCombo.js +58 -8
- package/dist/cjs/components/QuillSelect.d.ts.map +1 -1
- package/dist/cjs/components/QuillSelect.js +91 -14
- package/dist/cjs/components/QuillSelectWithCombo.js +6 -6
- package/dist/cjs/components/ReportBuilder/AddColumnModal.d.ts +6 -16
- package/dist/cjs/components/ReportBuilder/AddColumnModal.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddColumnModal.js +172 -75
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts +1 -5
- package/dist/cjs/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/AddSortPopover.js +2 -9
- package/dist/cjs/components/ReportBuilder/DraggableColumns.d.ts +17 -0
- package/dist/cjs/components/ReportBuilder/DraggableColumns.d.ts.map +1 -0
- package/dist/cjs/components/ReportBuilder/DraggableColumns.js +52 -0
- package/dist/cjs/components/ReportBuilder/DraggableItem.d.ts +17 -0
- package/dist/cjs/components/ReportBuilder/DraggableItem.d.ts.map +1 -0
- package/dist/cjs/components/ReportBuilder/DraggableItem.js +17 -0
- package/dist/cjs/components/ReportBuilder/FilterModal.d.ts +6 -12
- package/dist/cjs/components/ReportBuilder/FilterModal.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/FilterModal.js +29 -20
- package/dist/cjs/components/ReportBuilder/FilterStack.d.ts +8 -17
- package/dist/cjs/components/ReportBuilder/FilterStack.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/FilterStack.js +20 -86
- package/dist/cjs/components/ReportBuilder/convert.js +6 -6
- package/dist/cjs/components/ReportBuilder/ui.d.ts +8 -9
- package/dist/cjs/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/ui.js +30 -8
- package/dist/cjs/components/ReportBuilder/util.d.ts +2 -5
- package/dist/cjs/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/cjs/components/ReportBuilder/util.js +1 -1
- package/dist/cjs/components/UiComponents.d.ts +3 -2
- package/dist/cjs/components/UiComponents.d.ts.map +1 -1
- package/dist/cjs/components/UiComponents.js +13 -13
- package/dist/cjs/hooks/useAskQuill.d.ts +1 -1
- package/dist/cjs/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/cjs/hooks/useAskQuill.js +14 -12
- package/dist/cjs/hooks/useDashboard.d.ts +5 -3
- package/dist/cjs/hooks/useDashboard.d.ts.map +1 -1
- package/dist/cjs/hooks/useDashboard.js +8 -6
- package/dist/cjs/hooks/useOnClickOutside.d.ts +1 -0
- package/dist/cjs/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/cjs/hooks/useOnClickOutside.js +33 -0
- package/dist/cjs/internals/ReportBuilder/PivotForm.d.ts +2 -1
- package/dist/cjs/internals/ReportBuilder/PivotForm.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotForm.js +22 -15
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts +7 -5
- package/dist/cjs/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/cjs/internals/ReportBuilder/PivotModal.js +100 -48
- package/dist/cjs/models/Client.d.ts +4 -0
- package/dist/cjs/models/Client.d.ts.map +1 -1
- package/dist/cjs/models/Dashboard.d.ts +1 -0
- package/dist/cjs/models/Dashboard.d.ts.map +1 -1
- package/dist/cjs/models/Report.d.ts +2 -0
- package/dist/cjs/models/Report.d.ts.map +1 -1
- package/dist/cjs/models/ReportBuilder.d.ts +46 -0
- package/dist/cjs/models/ReportBuilder.d.ts.map +1 -0
- package/dist/cjs/models/ReportBuilder.js +19 -0
- package/dist/cjs/models/Tables.d.ts +5 -5
- package/dist/cjs/models/Tables.d.ts.map +1 -1
- package/dist/cjs/utils/astFilterProcessing.d.ts +4 -0
- package/dist/cjs/utils/astFilterProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/astFilterProcessing.js +301 -97
- package/dist/cjs/utils/astProcessing.d.ts +14 -4
- package/dist/cjs/utils/astProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/astProcessing.js +38 -4
- package/dist/cjs/utils/dashboard.d.ts.map +1 -1
- package/dist/cjs/utils/dashboard.js +18 -3
- package/dist/cjs/utils/dataFetcher.d.ts.map +1 -1
- package/dist/cjs/utils/dataFetcher.js +4 -3
- package/dist/cjs/utils/filterProcessing.d.ts +2 -11
- package/dist/cjs/utils/filterProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/filterProcessing.js +4 -16
- package/dist/cjs/utils/pivotConstructor.d.ts +2 -1
- package/dist/cjs/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/cjs/utils/pivotConstructor.js +4 -2
- package/dist/cjs/utils/pivotProcessing.d.ts +17 -7
- package/dist/cjs/utils/pivotProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/pivotProcessing.js +60 -51
- package/dist/cjs/utils/queryConstructor.d.ts.map +1 -1
- package/dist/cjs/utils/queryConstructor.js +15 -2
- package/dist/cjs/utils/report.d.ts +12 -9
- package/dist/cjs/utils/report.d.ts.map +1 -1
- package/dist/cjs/utils/report.js +114 -47
- package/dist/cjs/utils/reportBuilder.d.ts +88 -0
- package/dist/cjs/utils/reportBuilder.d.ts.map +1 -0
- package/dist/cjs/utils/reportBuilder.js +395 -0
- package/dist/cjs/utils/schema.d.ts +7 -0
- package/dist/cjs/utils/schema.d.ts.map +1 -1
- package/dist/cjs/utils/schema.js +36 -2
- package/dist/cjs/utils/tableProcessing.d.ts +59 -29
- package/dist/cjs/utils/tableProcessing.d.ts.map +1 -1
- package/dist/cjs/utils/tableProcessing.js +75 -90
- package/dist/cjs/utils/ui.d.ts +2 -0
- package/dist/cjs/utils/ui.d.ts.map +1 -0
- package/dist/cjs/utils/ui.js +18 -0
- package/dist/esm/Chart.d.ts.map +1 -1
- package/dist/esm/Chart.js +2 -2
- package/dist/esm/ChartBuilder.d.ts +1 -0
- package/dist/esm/ChartBuilder.d.ts.map +1 -1
- package/dist/esm/ChartBuilder.js +49 -15
- package/dist/esm/ChartEditor.d.ts +1 -1
- package/dist/esm/ChartEditor.d.ts.map +1 -1
- package/dist/esm/ChartEditor.js +2 -2
- package/dist/esm/Context.d.ts.map +1 -1
- package/dist/esm/Context.js +37 -26
- package/dist/esm/Dashboard.d.ts +2 -2
- package/dist/esm/Dashboard.d.ts.map +1 -1
- package/dist/esm/Dashboard.js +119 -103
- package/dist/esm/ReportBuilder.d.ts.map +1 -1
- package/dist/esm/ReportBuilder.js +878 -1581
- package/dist/esm/SQLEditor.d.ts.map +1 -1
- package/dist/esm/SQLEditor.js +23 -4
- package/dist/esm/Table.d.ts.map +1 -1
- package/dist/esm/components/Chart/CustomReferenceLine.js +1 -1
- package/dist/esm/components/Chart/GaugeChart.js +0 -6
- package/dist/esm/components/Dashboard/DashboardFilter.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardFilter.js +3 -3
- package/dist/esm/components/Dashboard/DashboardSection.d.ts +1 -1
- package/dist/esm/components/Dashboard/DashboardSection.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/DashboardSection.js +21 -20
- package/dist/esm/components/Dashboard/MetricComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/MetricComponent.js +1 -0
- package/dist/esm/components/Dashboard/TableComponent.d.ts.map +1 -1
- package/dist/esm/components/Dashboard/TableComponent.js +5 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.d.ts.map +1 -1
- package/dist/esm/components/QuillMultiSelectWithCombo.js +57 -7
- package/dist/esm/components/QuillSelect.d.ts.map +1 -1
- package/dist/esm/components/QuillSelect.js +58 -14
- package/dist/esm/components/QuillSelectWithCombo.js +6 -6
- package/dist/esm/components/ReportBuilder/AddColumnModal.d.ts +6 -16
- package/dist/esm/components/ReportBuilder/AddColumnModal.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddColumnModal.js +173 -76
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts +1 -5
- package/dist/esm/components/ReportBuilder/AddSortPopover.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/AddSortPopover.js +2 -9
- package/dist/esm/components/ReportBuilder/DraggableColumns.d.ts +17 -0
- package/dist/esm/components/ReportBuilder/DraggableColumns.d.ts.map +1 -0
- package/dist/esm/components/ReportBuilder/DraggableColumns.js +46 -0
- package/dist/esm/components/ReportBuilder/DraggableItem.d.ts +17 -0
- package/dist/esm/components/ReportBuilder/DraggableItem.d.ts.map +1 -0
- package/dist/esm/components/ReportBuilder/DraggableItem.js +14 -0
- package/dist/esm/components/ReportBuilder/FilterModal.d.ts +6 -12
- package/dist/esm/components/ReportBuilder/FilterModal.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/FilterModal.js +29 -20
- package/dist/esm/components/ReportBuilder/FilterStack.d.ts +8 -17
- package/dist/esm/components/ReportBuilder/FilterStack.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/FilterStack.js +21 -87
- package/dist/esm/components/ReportBuilder/convert.js +6 -6
- package/dist/esm/components/ReportBuilder/ui.d.ts +8 -9
- package/dist/esm/components/ReportBuilder/ui.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/ui.js +33 -11
- package/dist/esm/components/ReportBuilder/util.d.ts +2 -5
- package/dist/esm/components/ReportBuilder/util.d.ts.map +1 -1
- package/dist/esm/components/ReportBuilder/util.js +1 -1
- package/dist/esm/components/UiComponents.d.ts +3 -2
- package/dist/esm/components/UiComponents.d.ts.map +1 -1
- package/dist/esm/components/UiComponents.js +13 -13
- package/dist/esm/hooks/useAskQuill.d.ts +1 -1
- package/dist/esm/hooks/useAskQuill.d.ts.map +1 -1
- package/dist/esm/hooks/useAskQuill.js +14 -12
- package/dist/esm/hooks/useDashboard.d.ts +5 -3
- package/dist/esm/hooks/useDashboard.d.ts.map +1 -1
- package/dist/esm/hooks/useDashboard.js +8 -6
- package/dist/esm/hooks/useOnClickOutside.d.ts +1 -0
- package/dist/esm/hooks/useOnClickOutside.d.ts.map +1 -1
- package/dist/esm/hooks/useOnClickOutside.js +31 -0
- package/dist/esm/internals/ReportBuilder/PivotForm.d.ts +2 -1
- package/dist/esm/internals/ReportBuilder/PivotForm.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotForm.js +23 -16
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts +7 -5
- package/dist/esm/internals/ReportBuilder/PivotModal.d.ts.map +1 -1
- package/dist/esm/internals/ReportBuilder/PivotModal.js +101 -49
- package/dist/esm/models/Client.d.ts +4 -0
- package/dist/esm/models/Client.d.ts.map +1 -1
- package/dist/esm/models/Dashboard.d.ts +1 -0
- package/dist/esm/models/Dashboard.d.ts.map +1 -1
- package/dist/esm/models/Report.d.ts +2 -0
- package/dist/esm/models/Report.d.ts.map +1 -1
- package/dist/esm/models/ReportBuilder.d.ts +46 -0
- package/dist/esm/models/ReportBuilder.d.ts.map +1 -0
- package/dist/esm/models/ReportBuilder.js +16 -0
- package/dist/esm/models/Tables.d.ts +5 -5
- package/dist/esm/models/Tables.d.ts.map +1 -1
- package/dist/esm/utils/astFilterProcessing.d.ts +4 -0
- package/dist/esm/utils/astFilterProcessing.d.ts.map +1 -1
- package/dist/esm/utils/astFilterProcessing.js +300 -97
- package/dist/esm/utils/astProcessing.d.ts +14 -4
- package/dist/esm/utils/astProcessing.d.ts.map +1 -1
- package/dist/esm/utils/astProcessing.js +38 -5
- package/dist/esm/utils/dashboard.d.ts.map +1 -1
- package/dist/esm/utils/dashboard.js +18 -3
- package/dist/esm/utils/dataFetcher.d.ts.map +1 -1
- package/dist/esm/utils/dataFetcher.js +4 -3
- package/dist/esm/utils/filterProcessing.d.ts +2 -11
- package/dist/esm/utils/filterProcessing.d.ts.map +1 -1
- package/dist/esm/utils/filterProcessing.js +4 -15
- package/dist/esm/utils/pivotConstructor.d.ts +2 -1
- package/dist/esm/utils/pivotConstructor.d.ts.map +1 -1
- package/dist/esm/utils/pivotConstructor.js +4 -2
- package/dist/esm/utils/pivotProcessing.d.ts +17 -7
- package/dist/esm/utils/pivotProcessing.d.ts.map +1 -1
- package/dist/esm/utils/pivotProcessing.js +58 -49
- package/dist/esm/utils/queryConstructor.d.ts.map +1 -1
- package/dist/esm/utils/queryConstructor.js +15 -2
- package/dist/esm/utils/report.d.ts +12 -9
- package/dist/esm/utils/report.d.ts.map +1 -1
- package/dist/esm/utils/report.js +116 -46
- package/dist/esm/utils/reportBuilder.d.ts +88 -0
- package/dist/esm/utils/reportBuilder.d.ts.map +1 -0
- package/dist/esm/utils/reportBuilder.js +386 -0
- package/dist/esm/utils/schema.d.ts +7 -0
- package/dist/esm/utils/schema.d.ts.map +1 -1
- package/dist/esm/utils/schema.js +34 -1
- package/dist/esm/utils/tableProcessing.d.ts +59 -29
- package/dist/esm/utils/tableProcessing.d.ts.map +1 -1
- package/dist/esm/utils/tableProcessing.js +71 -86
- package/dist/esm/utils/ui.d.ts +2 -0
- package/dist/esm/utils/ui.d.ts.map +1 -0
- package/dist/esm/utils/ui.js +14 -0
- package/package.json +1 -1
|
@@ -6597,8 +6597,10 @@ const queryPatterns = [
|
|
|
6597
6597
|
}
|
|
6598
6598
|
else {
|
|
6599
6599
|
const unitLeft = astWhere.left?.right?.args?.value[0]?.column?.toLowerCase() ??
|
|
6600
|
+
astWhere.left?.right?.args?.value[0]?.value?.toLowerCase() ??
|
|
6600
6601
|
null;
|
|
6601
6602
|
const unitRight = astWhere.right?.right?.args?.value[0]?.column?.toLowerCase() ??
|
|
6603
|
+
astWhere.right?.right?.args?.value[0]?.value?.toLowerCase() ??
|
|
6602
6604
|
null;
|
|
6603
6605
|
return parseStartEndDate(operatorLeft, operatorRight, valueLeft, valueRight, stripTimeS(unitLeft.toLowerCase()), stripTimeS(unitRight.toLowerCase()));
|
|
6604
6606
|
}
|
|
@@ -7152,6 +7154,201 @@ const queryPatterns = [
|
|
|
7152
7154
|
_limit: null,
|
|
7153
7155
|
},
|
|
7154
7156
|
},
|
|
7157
|
+
{
|
|
7158
|
+
query: `
|
|
7159
|
+
SELECT * FROM transactions
|
|
7160
|
+
WHERE transaction_date >= TIMESTAMP_SUB(CURRENT_DATE(), INTERVAL 80 DAY)
|
|
7161
|
+
AND transaction_date < TIMESTAMP_SUB(CURRENT_DATE(), INTERVAL 40 DAY)
|
|
7162
|
+
`,
|
|
7163
|
+
value: function (astWhere) {
|
|
7164
|
+
if (astWhere.right.operator === 'AND') {
|
|
7165
|
+
// Avoid AND chains
|
|
7166
|
+
return -1;
|
|
7167
|
+
}
|
|
7168
|
+
const operatorLeft = astWhere.left.operator;
|
|
7169
|
+
const operatorRight = astWhere.right.operator;
|
|
7170
|
+
const valueLeft = astWhere.left.right?.args?.value[1]?.expr?.value;
|
|
7171
|
+
const valueRight = astWhere.right.right?.args?.value[1]?.expr?.value;
|
|
7172
|
+
if (!valueLeft || !valueRight) {
|
|
7173
|
+
return null;
|
|
7174
|
+
}
|
|
7175
|
+
if (operatorLeft === '>=' &&
|
|
7176
|
+
operatorRight === '<' &&
|
|
7177
|
+
valueLeft == valueRight * 2) {
|
|
7178
|
+
return valueRight;
|
|
7179
|
+
}
|
|
7180
|
+
else if (operatorLeft === '<' &&
|
|
7181
|
+
operatorRight === '>=' &&
|
|
7182
|
+
valueLeft * 2 == valueRight) {
|
|
7183
|
+
return valueLeft;
|
|
7184
|
+
}
|
|
7185
|
+
else {
|
|
7186
|
+
const unitLeft = astWhere.left?.right?.args?.value[1]?.unit?.toLowerCase() ??
|
|
7187
|
+
null;
|
|
7188
|
+
const unitRight = astWhere.right?.right?.args?.value[1]?.unit?.toLowerCase() ??
|
|
7189
|
+
null;
|
|
7190
|
+
return parseStartEndDate(operatorLeft, operatorRight, valueLeft, valueRight, stripTimeS(unitLeft.toLowerCase()), stripTimeS(unitRight.toLowerCase()));
|
|
7191
|
+
}
|
|
7192
|
+
},
|
|
7193
|
+
unit: function (astWhere) {
|
|
7194
|
+
const unitLeft = astWhere.left?.right?.args?.value[1]?.unit?.toLowerCase() ?? null;
|
|
7195
|
+
const unitRight = astWhere.right?.right?.args?.value[1]?.unit?.toLowerCase() ??
|
|
7196
|
+
null;
|
|
7197
|
+
return stripTimeS(unitLeft.toLowerCase()) ===
|
|
7198
|
+
stripTimeS(unitRight.toLowerCase())
|
|
7199
|
+
? stripTimeS(unitLeft.toLowerCase())
|
|
7200
|
+
: null;
|
|
7201
|
+
},
|
|
7202
|
+
ast: {
|
|
7203
|
+
type: 'select',
|
|
7204
|
+
as_struct_val: null,
|
|
7205
|
+
distinct: null,
|
|
7206
|
+
columns: [
|
|
7207
|
+
{
|
|
7208
|
+
expr: {
|
|
7209
|
+
type: 'column_ref',
|
|
7210
|
+
table: null,
|
|
7211
|
+
column: '*',
|
|
7212
|
+
},
|
|
7213
|
+
as: null,
|
|
7214
|
+
},
|
|
7215
|
+
],
|
|
7216
|
+
from: [
|
|
7217
|
+
{
|
|
7218
|
+
db: null,
|
|
7219
|
+
table: 'transactions',
|
|
7220
|
+
as: null,
|
|
7221
|
+
operator: null,
|
|
7222
|
+
},
|
|
7223
|
+
],
|
|
7224
|
+
for_sys_time_as_of: null,
|
|
7225
|
+
where: {
|
|
7226
|
+
type: 'binary_expr',
|
|
7227
|
+
operator: 'AND',
|
|
7228
|
+
left: {
|
|
7229
|
+
type: 'binary_expr',
|
|
7230
|
+
operator: '>=',
|
|
7231
|
+
left: {
|
|
7232
|
+
type: 'column_ref',
|
|
7233
|
+
table: null,
|
|
7234
|
+
column: {
|
|
7235
|
+
expr: {
|
|
7236
|
+
type: 'default',
|
|
7237
|
+
value: 'transaction_date',
|
|
7238
|
+
},
|
|
7239
|
+
offset: [],
|
|
7240
|
+
},
|
|
7241
|
+
collate: null,
|
|
7242
|
+
},
|
|
7243
|
+
right: {
|
|
7244
|
+
type: 'function',
|
|
7245
|
+
name: {
|
|
7246
|
+
name: [],
|
|
7247
|
+
schema: {
|
|
7248
|
+
type: 'default',
|
|
7249
|
+
value: 'TIMESTAMP_SUB',
|
|
7250
|
+
},
|
|
7251
|
+
},
|
|
7252
|
+
args: {
|
|
7253
|
+
type: 'expr_list',
|
|
7254
|
+
value: [
|
|
7255
|
+
{
|
|
7256
|
+
type: 'function',
|
|
7257
|
+
name: {
|
|
7258
|
+
name: [
|
|
7259
|
+
{
|
|
7260
|
+
type: 'default',
|
|
7261
|
+
value: 'CURRENT_DATE',
|
|
7262
|
+
},
|
|
7263
|
+
],
|
|
7264
|
+
},
|
|
7265
|
+
args: {
|
|
7266
|
+
type: 'expr_list',
|
|
7267
|
+
value: [],
|
|
7268
|
+
},
|
|
7269
|
+
over: null,
|
|
7270
|
+
},
|
|
7271
|
+
{
|
|
7272
|
+
type: 'interval',
|
|
7273
|
+
expr: {
|
|
7274
|
+
type: 'number',
|
|
7275
|
+
value: 80,
|
|
7276
|
+
},
|
|
7277
|
+
unit: 'day',
|
|
7278
|
+
},
|
|
7279
|
+
],
|
|
7280
|
+
},
|
|
7281
|
+
over: null,
|
|
7282
|
+
},
|
|
7283
|
+
},
|
|
7284
|
+
right: {
|
|
7285
|
+
type: 'binary_expr',
|
|
7286
|
+
operator: '<',
|
|
7287
|
+
left: {
|
|
7288
|
+
type: 'column_ref',
|
|
7289
|
+
table: null,
|
|
7290
|
+
column: {
|
|
7291
|
+
expr: {
|
|
7292
|
+
type: 'default',
|
|
7293
|
+
value: 'transaction_date',
|
|
7294
|
+
},
|
|
7295
|
+
offset: [],
|
|
7296
|
+
},
|
|
7297
|
+
collate: null,
|
|
7298
|
+
},
|
|
7299
|
+
right: {
|
|
7300
|
+
type: 'function',
|
|
7301
|
+
name: {
|
|
7302
|
+
name: [],
|
|
7303
|
+
schema: {
|
|
7304
|
+
type: 'default',
|
|
7305
|
+
value: 'TIMESTAMP_SUB',
|
|
7306
|
+
},
|
|
7307
|
+
},
|
|
7308
|
+
args: {
|
|
7309
|
+
type: 'expr_list',
|
|
7310
|
+
value: [
|
|
7311
|
+
{
|
|
7312
|
+
type: 'function',
|
|
7313
|
+
name: {
|
|
7314
|
+
name: [
|
|
7315
|
+
{
|
|
7316
|
+
type: 'default',
|
|
7317
|
+
value: 'CURRENT_DATE',
|
|
7318
|
+
},
|
|
7319
|
+
],
|
|
7320
|
+
},
|
|
7321
|
+
args: {
|
|
7322
|
+
type: 'expr_list',
|
|
7323
|
+
value: [],
|
|
7324
|
+
},
|
|
7325
|
+
over: null,
|
|
7326
|
+
},
|
|
7327
|
+
{
|
|
7328
|
+
type: 'interval',
|
|
7329
|
+
expr: {
|
|
7330
|
+
type: 'number',
|
|
7331
|
+
value: 40,
|
|
7332
|
+
},
|
|
7333
|
+
unit: 'day',
|
|
7334
|
+
},
|
|
7335
|
+
],
|
|
7336
|
+
},
|
|
7337
|
+
over: null,
|
|
7338
|
+
},
|
|
7339
|
+
},
|
|
7340
|
+
},
|
|
7341
|
+
with: null,
|
|
7342
|
+
groupby: null,
|
|
7343
|
+
having: null,
|
|
7344
|
+
qualify: null,
|
|
7345
|
+
orderby: null,
|
|
7346
|
+
limit: null,
|
|
7347
|
+
window: null,
|
|
7348
|
+
_orderby: null,
|
|
7349
|
+
_limit: null,
|
|
7350
|
+
},
|
|
7351
|
+
},
|
|
7155
7352
|
],
|
|
7156
7353
|
mysql: [
|
|
7157
7354
|
{
|
|
@@ -8147,7 +8344,7 @@ function generateWhereChecker(astWhere) {
|
|
|
8147
8344
|
* Function that takes in a field value and generates an ast
|
|
8148
8345
|
* that wraps it in a LOWER() function
|
|
8149
8346
|
*/
|
|
8150
|
-
function fieldColumnToLowerCaseAst(field, db, isColumnRef) {
|
|
8347
|
+
function fieldColumnToLowerCaseAst(field, db, isColumnRef, table) {
|
|
8151
8348
|
switch (db) {
|
|
8152
8349
|
case 'redshift':
|
|
8153
8350
|
return {
|
|
@@ -8166,7 +8363,7 @@ function fieldColumnToLowerCaseAst(field, db, isColumnRef) {
|
|
|
8166
8363
|
isColumnRef
|
|
8167
8364
|
? {
|
|
8168
8365
|
type: 'column_ref',
|
|
8169
|
-
table: null,
|
|
8366
|
+
table: table ?? null,
|
|
8170
8367
|
column: {
|
|
8171
8368
|
expr: {
|
|
8172
8369
|
type: 'default',
|
|
@@ -8198,7 +8395,7 @@ function fieldColumnToLowerCaseAst(field, db, isColumnRef) {
|
|
|
8198
8395
|
isColumnRef
|
|
8199
8396
|
? {
|
|
8200
8397
|
type: 'column_ref',
|
|
8201
|
-
table: null,
|
|
8398
|
+
table: table ?? null,
|
|
8202
8399
|
column: field,
|
|
8203
8400
|
}
|
|
8204
8401
|
: {
|
|
@@ -8224,7 +8421,7 @@ function fieldColumnToLowerCaseAst(field, db, isColumnRef) {
|
|
|
8224
8421
|
isColumnRef
|
|
8225
8422
|
? {
|
|
8226
8423
|
type: 'column_ref',
|
|
8227
|
-
table: null,
|
|
8424
|
+
table: table ?? null,
|
|
8228
8425
|
column: field,
|
|
8229
8426
|
}
|
|
8230
8427
|
: {
|
|
@@ -8252,7 +8449,7 @@ function fieldColumnToLowerCaseAst(field, db, isColumnRef) {
|
|
|
8252
8449
|
isColumnRef
|
|
8253
8450
|
? {
|
|
8254
8451
|
type: 'column_ref',
|
|
8255
|
-
table: null,
|
|
8452
|
+
table: table ?? null,
|
|
8256
8453
|
column: field,
|
|
8257
8454
|
}
|
|
8258
8455
|
: {
|
|
@@ -8280,7 +8477,7 @@ function fieldColumnToLowerCaseAst(field, db, isColumnRef) {
|
|
|
8280
8477
|
isColumnRef
|
|
8281
8478
|
? {
|
|
8282
8479
|
type: 'column_ref',
|
|
8283
|
-
table: null,
|
|
8480
|
+
table: table ?? null,
|
|
8284
8481
|
db: null,
|
|
8285
8482
|
schema: null,
|
|
8286
8483
|
column: field,
|
|
@@ -8313,7 +8510,7 @@ function fieldColumnToLowerCaseAst(field, db, isColumnRef) {
|
|
|
8313
8510
|
isColumnRef
|
|
8314
8511
|
? {
|
|
8315
8512
|
type: 'column_ref',
|
|
8316
|
-
table: null,
|
|
8513
|
+
table: table ?? null,
|
|
8317
8514
|
column: {
|
|
8318
8515
|
expr: {
|
|
8319
8516
|
type: 'default',
|
|
@@ -8364,6 +8561,9 @@ function lowerFunctionToField(lower, db) {
|
|
|
8364
8561
|
* Function that extracts a field value
|
|
8365
8562
|
*/
|
|
8366
8563
|
export function getFieldFromExpression(expr, databaseType) {
|
|
8564
|
+
if (typeof expr === 'string') {
|
|
8565
|
+
return expr;
|
|
8566
|
+
}
|
|
8367
8567
|
return (expr.column?.expr?.value ||
|
|
8368
8568
|
expr.column ||
|
|
8369
8569
|
expr.args?.value?.[1]?.expr?.column ||
|
|
@@ -8386,6 +8586,31 @@ export function getFieldFromExpression(expr, databaseType) {
|
|
|
8386
8586
|
expr.args?.source?.column ||
|
|
8387
8587
|
expr.value);
|
|
8388
8588
|
}
|
|
8589
|
+
/**
|
|
8590
|
+
* Function that extracts a table
|
|
8591
|
+
*/
|
|
8592
|
+
export function getTableFromExpression(expr, databaseType) {
|
|
8593
|
+
return (expr.column?.expr?.table ||
|
|
8594
|
+
expr.args?.value?.[1]?.expr?.table ||
|
|
8595
|
+
(databaseType === 'mssql'
|
|
8596
|
+
? (expr.args?.value?.[1]?.table ?? expr.args.value?.[0]?.table)
|
|
8597
|
+
: null) ||
|
|
8598
|
+
expr.args?.value?.[1]?.args?.value?.[0]?.column?.expr?.table ||
|
|
8599
|
+
expr.args?.value?.[0]?.value?.expr?.table ||
|
|
8600
|
+
expr.args?.value?.[1]?.column?.expr?.table ||
|
|
8601
|
+
expr.args?.value?.[0]?.column?.expr?.table ||
|
|
8602
|
+
(expr.name?.schema?.value !== 'DATETIME_TRUNC' // BigQuery edge case
|
|
8603
|
+
? expr.args?.value?.[1]?.table
|
|
8604
|
+
: null) ||
|
|
8605
|
+
(expr.args?.value?.[1]?.type === 'double_quote_string'
|
|
8606
|
+
? expr.args?.value?.[1]?.table
|
|
8607
|
+
: null) ||
|
|
8608
|
+
expr.args?.value?.[0]?.table ||
|
|
8609
|
+
expr.args?.value?.[0]?.table ||
|
|
8610
|
+
expr.args?.source?.column?.expr?.table ||
|
|
8611
|
+
expr.args?.source?.table ||
|
|
8612
|
+
expr.table);
|
|
8613
|
+
}
|
|
8389
8614
|
/**
|
|
8390
8615
|
* @param ast
|
|
8391
8616
|
* @param client
|
|
@@ -8499,50 +8724,18 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8499
8724
|
if (!left || !operator || !right) {
|
|
8500
8725
|
return null;
|
|
8501
8726
|
}
|
|
8502
|
-
let
|
|
8727
|
+
let leftExpr;
|
|
8503
8728
|
// First, determine which column field is being referenced
|
|
8504
8729
|
// The location of the field in the ast tree varies by database type and filter type
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
|
|
8513
|
-
|
|
8514
|
-
switch (leftExpr.type) {
|
|
8515
|
-
case 'function':
|
|
8516
|
-
field =
|
|
8517
|
-
leftExpr.args?.value[1]?.column?.expr?.value ??
|
|
8518
|
-
leftExpr.args?.value[0]?.column?.expr?.value ??
|
|
8519
|
-
lowerFunctionToField(leftExpr, db) ??
|
|
8520
|
-
getFieldFromExpression(leftExpr, db);
|
|
8521
|
-
break;
|
|
8522
|
-
default:
|
|
8523
|
-
field = getFieldFromExpression(leftExpr, db);
|
|
8524
|
-
if (!field) {
|
|
8525
|
-
console.error('Could not determine field: ', leftExpr);
|
|
8526
|
-
return null;
|
|
8527
|
-
}
|
|
8528
|
-
}
|
|
8529
|
-
break;
|
|
8530
|
-
case 'snowflake':
|
|
8531
|
-
case 'bigquery':
|
|
8532
|
-
case 'mysql':
|
|
8533
|
-
leftExpr = left;
|
|
8534
|
-
while (leftExpr.type === 'binary_expr') {
|
|
8535
|
-
leftExpr = leftExpr.left;
|
|
8536
|
-
}
|
|
8537
|
-
field = getFieldFromExpression(leftExpr, db);
|
|
8538
|
-
if (!field) {
|
|
8539
|
-
console.error('Could not determine field: ', leftExpr);
|
|
8540
|
-
return null;
|
|
8541
|
-
}
|
|
8542
|
-
break;
|
|
8543
|
-
default:
|
|
8544
|
-
console.error('Unknown database source: ', db);
|
|
8545
|
-
return null;
|
|
8730
|
+
leftExpr = left;
|
|
8731
|
+
while (leftExpr.type === 'binary_expr') {
|
|
8732
|
+
leftExpr = leftExpr.left;
|
|
8733
|
+
}
|
|
8734
|
+
const field = getFieldFromExpression(leftExpr, db);
|
|
8735
|
+
const table = getTableFromExpression(leftExpr, db);
|
|
8736
|
+
if (!field) {
|
|
8737
|
+
console.error('Could not determine field: ', leftExpr);
|
|
8738
|
+
return null;
|
|
8546
8739
|
}
|
|
8547
8740
|
if (!field) {
|
|
8548
8741
|
console.error('Could not determine field: ', leftExpr);
|
|
@@ -8611,7 +8804,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8611
8804
|
}
|
|
8612
8805
|
// If columns are provided, look for the field in columns and assign the correct type
|
|
8613
8806
|
if (columns && fieldType !== FieldType.Null) {
|
|
8614
|
-
const column = columns.find((col) => col.field === field);
|
|
8807
|
+
const column = columns.find((col) => col.field === field && (!col.table || !table || col.table === table));
|
|
8615
8808
|
if (column) {
|
|
8616
8809
|
if (isDateType(column.fieldType)) {
|
|
8617
8810
|
fieldType = FieldType.Date;
|
|
@@ -8707,6 +8900,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8707
8900
|
fieldType: FieldType.String,
|
|
8708
8901
|
operator: mappedOperator,
|
|
8709
8902
|
value: (lowerFunctionToField(right, db) ?? '').replaceAll('%', ''),
|
|
8903
|
+
table,
|
|
8710
8904
|
};
|
|
8711
8905
|
case InternalFilterType.StringInFilter:
|
|
8712
8906
|
return {
|
|
@@ -8715,6 +8909,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8715
8909
|
fieldType: FieldType.String,
|
|
8716
8910
|
operator: mappedOperator,
|
|
8717
8911
|
value: right.value.map((v) => (lowerFunctionToField(v, db) ?? '').replaceAll('%', '')),
|
|
8912
|
+
table,
|
|
8718
8913
|
};
|
|
8719
8914
|
case InternalFilterType.NumericFilter:
|
|
8720
8915
|
return {
|
|
@@ -8723,6 +8918,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8723
8918
|
fieldType: FieldType.Number,
|
|
8724
8919
|
operator: mappedOperator,
|
|
8725
8920
|
value: Number(right.value),
|
|
8921
|
+
table,
|
|
8726
8922
|
};
|
|
8727
8923
|
case InternalFilterType.NullFilter:
|
|
8728
8924
|
return {
|
|
@@ -8731,6 +8927,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8731
8927
|
fieldType: FieldType.Null,
|
|
8732
8928
|
operator: mappedOperator,
|
|
8733
8929
|
value: null,
|
|
8930
|
+
table,
|
|
8734
8931
|
};
|
|
8735
8932
|
case InternalFilterType.DateCustomFilter: {
|
|
8736
8933
|
const rightExprList = right;
|
|
@@ -8745,6 +8942,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8745
8942
|
fieldType: FieldType.Date,
|
|
8746
8943
|
operator: DateOperator.Custom,
|
|
8747
8944
|
value: values,
|
|
8945
|
+
table,
|
|
8748
8946
|
};
|
|
8749
8947
|
}
|
|
8750
8948
|
case InternalFilterType.DateComparisonFilter: {
|
|
@@ -8763,6 +8961,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8763
8961
|
fieldType: FieldType.Date,
|
|
8764
8962
|
operator: DateOperator.Custom,
|
|
8765
8963
|
value: { startDate: right.value, endDate: right.value },
|
|
8964
|
+
table,
|
|
8766
8965
|
};
|
|
8767
8966
|
}
|
|
8768
8967
|
return {
|
|
@@ -8771,6 +8970,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8771
8970
|
fieldType: FieldType.Date,
|
|
8772
8971
|
operator: numericDateComparison,
|
|
8773
8972
|
value: right.value,
|
|
8973
|
+
table,
|
|
8774
8974
|
};
|
|
8775
8975
|
}
|
|
8776
8976
|
}
|
|
@@ -8788,6 +8988,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8788
8988
|
fieldType: FieldType.Date,
|
|
8789
8989
|
operator: dateOperator,
|
|
8790
8990
|
value,
|
|
8991
|
+
table,
|
|
8791
8992
|
};
|
|
8792
8993
|
}
|
|
8793
8994
|
else {
|
|
@@ -8797,6 +8998,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8797
8998
|
fieldType: FieldType.Date,
|
|
8798
8999
|
operator: DateOperator.Custom,
|
|
8799
9000
|
value: value.value,
|
|
9001
|
+
table,
|
|
8800
9002
|
};
|
|
8801
9003
|
}
|
|
8802
9004
|
}
|
|
@@ -8814,6 +9016,7 @@ export const astToFilter = (ast, db, columns) => {
|
|
|
8814
9016
|
fieldType: FieldType.Boolean,
|
|
8815
9017
|
operator: mappedOperator,
|
|
8816
9018
|
value: value,
|
|
9019
|
+
table,
|
|
8817
9020
|
};
|
|
8818
9021
|
}
|
|
8819
9022
|
}
|
|
@@ -8859,7 +9062,7 @@ export const filterTreeToAst = (filterTree, db) => {
|
|
|
8859
9062
|
* Deterministic function that converts Filter objects to a leaf node ast
|
|
8860
9063
|
*/
|
|
8861
9064
|
export const filterToAst = (filter, db) => {
|
|
8862
|
-
const { field, operator, value } = filter;
|
|
9065
|
+
const { field, operator, value, table } = filter;
|
|
8863
9066
|
const mappedOperator = operatorMap[operator][0];
|
|
8864
9067
|
// Generate SQL AST based on the filter type
|
|
8865
9068
|
switch (filter.fieldType) {
|
|
@@ -8873,7 +9076,7 @@ export const filterToAst = (filter, db) => {
|
|
|
8873
9076
|
return {
|
|
8874
9077
|
type: 'binary_expr',
|
|
8875
9078
|
operator: mappedOperator,
|
|
8876
|
-
left: fieldColumnToLowerCaseAst(`${field.replaceAll('%', '')}`, db, true),
|
|
9079
|
+
left: fieldColumnToLowerCaseAst(`${field.replaceAll('%', '')}`, db, true, table),
|
|
8877
9080
|
right: {
|
|
8878
9081
|
type: 'expr_list',
|
|
8879
9082
|
value: value.map((v) => {
|
|
@@ -8889,7 +9092,7 @@ export const filterToAst = (filter, db) => {
|
|
|
8889
9092
|
return {
|
|
8890
9093
|
type: 'binary_expr',
|
|
8891
9094
|
operator: mappedOperator,
|
|
8892
|
-
left: fieldColumnToLowerCaseAst(field, db, true),
|
|
9095
|
+
left: fieldColumnToLowerCaseAst(field, db, true, table),
|
|
8893
9096
|
right: fieldColumnToLowerCaseAst(value, db, false),
|
|
8894
9097
|
};
|
|
8895
9098
|
case 'LIKE':
|
|
@@ -8899,7 +9102,7 @@ export const filterToAst = (filter, db) => {
|
|
|
8899
9102
|
return {
|
|
8900
9103
|
type: 'binary_expr',
|
|
8901
9104
|
operator: mappedOperator,
|
|
8902
|
-
left: fieldColumnToLowerCaseAst(field, db, true),
|
|
9105
|
+
left: fieldColumnToLowerCaseAst(field, db, true, table),
|
|
8903
9106
|
right: fieldColumnToLowerCaseAst(`%${value.replaceAll('%', '')}%`, db, false),
|
|
8904
9107
|
};
|
|
8905
9108
|
default:
|
|
@@ -8909,7 +9112,7 @@ export const filterToAst = (filter, db) => {
|
|
|
8909
9112
|
return {
|
|
8910
9113
|
type: 'binary_expr',
|
|
8911
9114
|
operator: mappedOperator,
|
|
8912
|
-
left: fieldColumnToLowerCaseAst(field, db, true),
|
|
9115
|
+
left: fieldColumnToLowerCaseAst(field, db, true, table),
|
|
8913
9116
|
right: fieldColumnToLowerCaseAst(value, db, false),
|
|
8914
9117
|
};
|
|
8915
9118
|
}
|
|
@@ -8919,7 +9122,7 @@ export const filterToAst = (filter, db) => {
|
|
|
8919
9122
|
return {
|
|
8920
9123
|
type: 'binary_expr',
|
|
8921
9124
|
operator: mappedOperator,
|
|
8922
|
-
left: { type: 'column_ref', table: null, column: field },
|
|
9125
|
+
left: { type: 'column_ref', table: table ?? null, column: field },
|
|
8923
9126
|
right: { type: 'number', value: Number(value) },
|
|
8924
9127
|
};
|
|
8925
9128
|
}
|
|
@@ -8931,7 +9134,7 @@ export const filterToAst = (filter, db) => {
|
|
|
8931
9134
|
operator: mappedOperator,
|
|
8932
9135
|
left: {
|
|
8933
9136
|
type: 'column_ref',
|
|
8934
|
-
table: null,
|
|
9137
|
+
table: table ?? null,
|
|
8935
9138
|
column: field,
|
|
8936
9139
|
},
|
|
8937
9140
|
right: {
|
|
@@ -8960,7 +9163,7 @@ export const filterToAst = (filter, db) => {
|
|
|
8960
9163
|
operator: '>=',
|
|
8961
9164
|
left: {
|
|
8962
9165
|
type: 'column_ref',
|
|
8963
|
-
table: null,
|
|
9166
|
+
table: table ?? null,
|
|
8964
9167
|
column: {
|
|
8965
9168
|
expr: {
|
|
8966
9169
|
type: 'default',
|
|
@@ -9019,7 +9222,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9019
9222
|
operator: '>=',
|
|
9020
9223
|
left: {
|
|
9021
9224
|
type: 'column_ref',
|
|
9022
|
-
table: null,
|
|
9225
|
+
table: table ?? null,
|
|
9023
9226
|
column: field,
|
|
9024
9227
|
},
|
|
9025
9228
|
right: {
|
|
@@ -9059,7 +9262,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9059
9262
|
operator: '>=',
|
|
9060
9263
|
left: {
|
|
9061
9264
|
type: 'column_ref',
|
|
9062
|
-
table: null,
|
|
9265
|
+
table: table ?? null,
|
|
9063
9266
|
column: field,
|
|
9064
9267
|
},
|
|
9065
9268
|
right: {
|
|
@@ -9124,7 +9327,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9124
9327
|
operator: '>=',
|
|
9125
9328
|
left: {
|
|
9126
9329
|
type: 'column_ref',
|
|
9127
|
-
table: null,
|
|
9330
|
+
table: table ?? null,
|
|
9128
9331
|
column: field,
|
|
9129
9332
|
},
|
|
9130
9333
|
right: {
|
|
@@ -9158,7 +9361,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9158
9361
|
operator: '>=',
|
|
9159
9362
|
left: {
|
|
9160
9363
|
type: 'column_ref',
|
|
9161
|
-
table: null,
|
|
9364
|
+
table: table ?? null,
|
|
9162
9365
|
column: {
|
|
9163
9366
|
expr: {
|
|
9164
9367
|
type: 'default',
|
|
@@ -9199,7 +9402,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9199
9402
|
operator: '>=',
|
|
9200
9403
|
left: {
|
|
9201
9404
|
type: 'column_ref',
|
|
9202
|
-
table: null,
|
|
9405
|
+
table: table ?? null,
|
|
9203
9406
|
column: {
|
|
9204
9407
|
expr: {
|
|
9205
9408
|
type: 'default',
|
|
@@ -9241,7 +9444,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9241
9444
|
operator: '>=',
|
|
9242
9445
|
left: {
|
|
9243
9446
|
type: 'column_ref',
|
|
9244
|
-
table: null,
|
|
9447
|
+
table: table ?? null,
|
|
9245
9448
|
db: null,
|
|
9246
9449
|
schema: null,
|
|
9247
9450
|
column: field,
|
|
@@ -9308,7 +9511,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9308
9511
|
operator: '>=',
|
|
9309
9512
|
left: {
|
|
9310
9513
|
type: 'column_ref',
|
|
9311
|
-
table: null,
|
|
9514
|
+
table: table ?? null,
|
|
9312
9515
|
column: {
|
|
9313
9516
|
expr: {
|
|
9314
9517
|
type: 'default',
|
|
@@ -9356,7 +9559,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9356
9559
|
operator: '<',
|
|
9357
9560
|
left: {
|
|
9358
9561
|
type: 'column_ref',
|
|
9359
|
-
table: null,
|
|
9562
|
+
table: table ?? null,
|
|
9360
9563
|
column: {
|
|
9361
9564
|
expr: {
|
|
9362
9565
|
type: 'default',
|
|
@@ -9437,7 +9640,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9437
9640
|
},
|
|
9438
9641
|
{
|
|
9439
9642
|
type: 'column_ref',
|
|
9440
|
-
table: null,
|
|
9643
|
+
table: table ?? null,
|
|
9441
9644
|
column: field,
|
|
9442
9645
|
},
|
|
9443
9646
|
],
|
|
@@ -9498,7 +9701,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9498
9701
|
value: [
|
|
9499
9702
|
{
|
|
9500
9703
|
type: 'column_ref',
|
|
9501
|
-
table: null,
|
|
9704
|
+
table: table ?? null,
|
|
9502
9705
|
column: field,
|
|
9503
9706
|
},
|
|
9504
9707
|
{
|
|
@@ -9569,7 +9772,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9569
9772
|
value: [
|
|
9570
9773
|
{
|
|
9571
9774
|
type: 'column_ref',
|
|
9572
|
-
table: null,
|
|
9775
|
+
table: table ?? null,
|
|
9573
9776
|
column: field,
|
|
9574
9777
|
},
|
|
9575
9778
|
],
|
|
@@ -9628,7 +9831,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9628
9831
|
value: [
|
|
9629
9832
|
{
|
|
9630
9833
|
type: 'column_ref',
|
|
9631
|
-
table: null,
|
|
9834
|
+
table: table ?? null,
|
|
9632
9835
|
column: field,
|
|
9633
9836
|
},
|
|
9634
9837
|
],
|
|
@@ -9717,7 +9920,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9717
9920
|
value: [
|
|
9718
9921
|
{
|
|
9719
9922
|
type: 'column_ref',
|
|
9720
|
-
table: null,
|
|
9923
|
+
table: table ?? null,
|
|
9721
9924
|
column: {
|
|
9722
9925
|
expr: {
|
|
9723
9926
|
type: 'default',
|
|
@@ -9793,7 +9996,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9793
9996
|
},
|
|
9794
9997
|
{
|
|
9795
9998
|
type: 'column_ref',
|
|
9796
|
-
table: null,
|
|
9999
|
+
table: table ?? null,
|
|
9797
10000
|
column: {
|
|
9798
10001
|
expr: {
|
|
9799
10002
|
type: 'default',
|
|
@@ -9863,7 +10066,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9863
10066
|
},
|
|
9864
10067
|
{
|
|
9865
10068
|
type: 'column_ref',
|
|
9866
|
-
table: null,
|
|
10069
|
+
table: table ?? null,
|
|
9867
10070
|
column: {
|
|
9868
10071
|
expr: {
|
|
9869
10072
|
type: 'default',
|
|
@@ -9933,7 +10136,7 @@ export const filterToAst = (filter, db) => {
|
|
|
9933
10136
|
},
|
|
9934
10137
|
{
|
|
9935
10138
|
type: 'column_ref',
|
|
9936
|
-
table: null,
|
|
10139
|
+
table: table ?? null,
|
|
9937
10140
|
column: {
|
|
9938
10141
|
expr: {
|
|
9939
10142
|
type: 'default',
|
|
@@ -10007,7 +10210,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10007
10210
|
},
|
|
10008
10211
|
{
|
|
10009
10212
|
type: 'column_ref',
|
|
10010
|
-
table: null,
|
|
10213
|
+
table: table ?? null,
|
|
10011
10214
|
db: null,
|
|
10012
10215
|
schema: null,
|
|
10013
10216
|
column: field,
|
|
@@ -10074,7 +10277,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10074
10277
|
operator: '>=',
|
|
10075
10278
|
left: {
|
|
10076
10279
|
type: 'column_ref',
|
|
10077
|
-
table: null,
|
|
10280
|
+
table: table ?? null,
|
|
10078
10281
|
column: {
|
|
10079
10282
|
expr: {
|
|
10080
10283
|
type: 'default',
|
|
@@ -10132,7 +10335,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10132
10335
|
operator: '<',
|
|
10133
10336
|
left: {
|
|
10134
10337
|
type: 'column_ref',
|
|
10135
|
-
table: null,
|
|
10338
|
+
table: table ?? null,
|
|
10136
10339
|
column: {
|
|
10137
10340
|
expr: {
|
|
10138
10341
|
type: 'default',
|
|
@@ -10196,7 +10399,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10196
10399
|
operator: '>=',
|
|
10197
10400
|
left: {
|
|
10198
10401
|
type: 'column_ref',
|
|
10199
|
-
table: null,
|
|
10402
|
+
table: table ?? null,
|
|
10200
10403
|
column: field,
|
|
10201
10404
|
},
|
|
10202
10405
|
right: {
|
|
@@ -10235,7 +10438,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10235
10438
|
operator: '<',
|
|
10236
10439
|
left: {
|
|
10237
10440
|
type: 'column_ref',
|
|
10238
|
-
table: null,
|
|
10441
|
+
table: table ?? null,
|
|
10239
10442
|
column: field,
|
|
10240
10443
|
},
|
|
10241
10444
|
right: {
|
|
@@ -10280,7 +10483,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10280
10483
|
operator: '>=',
|
|
10281
10484
|
left: {
|
|
10282
10485
|
type: 'column_ref',
|
|
10283
|
-
table: null,
|
|
10486
|
+
table: table ?? null,
|
|
10284
10487
|
column: field,
|
|
10285
10488
|
},
|
|
10286
10489
|
right: {
|
|
@@ -10347,7 +10550,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10347
10550
|
operator: '<',
|
|
10348
10551
|
left: {
|
|
10349
10552
|
type: 'column_ref',
|
|
10350
|
-
table: null,
|
|
10553
|
+
table: table ?? null,
|
|
10351
10554
|
column: field,
|
|
10352
10555
|
},
|
|
10353
10556
|
right: {
|
|
@@ -10420,7 +10623,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10420
10623
|
operator: '>=',
|
|
10421
10624
|
left: {
|
|
10422
10625
|
type: 'column_ref',
|
|
10423
|
-
table: null,
|
|
10626
|
+
table: table ?? null,
|
|
10424
10627
|
column: field,
|
|
10425
10628
|
},
|
|
10426
10629
|
right: {
|
|
@@ -10459,7 +10662,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10459
10662
|
operator: '<',
|
|
10460
10663
|
left: {
|
|
10461
10664
|
type: 'column_ref',
|
|
10462
|
-
table: null,
|
|
10665
|
+
table: table ?? null,
|
|
10463
10666
|
column: field,
|
|
10464
10667
|
},
|
|
10465
10668
|
right: {
|
|
@@ -10504,7 +10707,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10504
10707
|
operator: '>=',
|
|
10505
10708
|
left: {
|
|
10506
10709
|
type: 'column_ref',
|
|
10507
|
-
table: null,
|
|
10710
|
+
table: table ?? null,
|
|
10508
10711
|
column: {
|
|
10509
10712
|
expr: {
|
|
10510
10713
|
type: 'default',
|
|
@@ -10544,7 +10747,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10544
10747
|
operator: '<',
|
|
10545
10748
|
left: {
|
|
10546
10749
|
type: 'column_ref',
|
|
10547
|
-
table: null,
|
|
10750
|
+
table: table ?? null,
|
|
10548
10751
|
column: {
|
|
10549
10752
|
expr: {
|
|
10550
10753
|
type: 'default',
|
|
@@ -10590,7 +10793,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10590
10793
|
operator: '>=',
|
|
10591
10794
|
left: {
|
|
10592
10795
|
type: 'column_ref',
|
|
10593
|
-
table: null,
|
|
10796
|
+
table: table ?? null,
|
|
10594
10797
|
column: {
|
|
10595
10798
|
expr: {
|
|
10596
10799
|
type: 'default',
|
|
@@ -10631,7 +10834,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10631
10834
|
operator: '<',
|
|
10632
10835
|
left: {
|
|
10633
10836
|
type: 'column_ref',
|
|
10634
|
-
table: null,
|
|
10837
|
+
table: table ?? null,
|
|
10635
10838
|
column: {
|
|
10636
10839
|
expr: {
|
|
10637
10840
|
type: 'default',
|
|
@@ -10678,7 +10881,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10678
10881
|
operator: '>=',
|
|
10679
10882
|
left: {
|
|
10680
10883
|
type: 'column_ref',
|
|
10681
|
-
table: null,
|
|
10884
|
+
table: table ?? null,
|
|
10682
10885
|
db: null,
|
|
10683
10886
|
schema: null,
|
|
10684
10887
|
column: field,
|
|
@@ -10735,7 +10938,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10735
10938
|
operator: '<',
|
|
10736
10939
|
left: {
|
|
10737
10940
|
type: 'column_ref',
|
|
10738
|
-
table: null,
|
|
10941
|
+
table: table ?? null,
|
|
10739
10942
|
db: null,
|
|
10740
10943
|
schema: null,
|
|
10741
10944
|
column: field,
|
|
@@ -10802,7 +11005,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10802
11005
|
return {
|
|
10803
11006
|
left: {
|
|
10804
11007
|
column: field,
|
|
10805
|
-
table: null,
|
|
11008
|
+
table: table ?? null,
|
|
10806
11009
|
type: 'column_ref',
|
|
10807
11010
|
},
|
|
10808
11011
|
operator: '=',
|
|
@@ -10813,7 +11016,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10813
11016
|
return {
|
|
10814
11017
|
left: {
|
|
10815
11018
|
column: field,
|
|
10816
|
-
table: null,
|
|
11019
|
+
table: table ?? null,
|
|
10817
11020
|
type: 'column_ref',
|
|
10818
11021
|
},
|
|
10819
11022
|
operator: '>',
|
|
@@ -10824,7 +11027,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10824
11027
|
return {
|
|
10825
11028
|
left: {
|
|
10826
11029
|
column: field,
|
|
10827
|
-
table: null,
|
|
11030
|
+
table: table ?? null,
|
|
10828
11031
|
type: 'column_ref',
|
|
10829
11032
|
},
|
|
10830
11033
|
operator: '>=',
|
|
@@ -10835,7 +11038,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10835
11038
|
return {
|
|
10836
11039
|
left: {
|
|
10837
11040
|
column: field,
|
|
10838
|
-
table: null,
|
|
11041
|
+
table: table ?? null,
|
|
10839
11042
|
type: 'column_ref',
|
|
10840
11043
|
},
|
|
10841
11044
|
operator: '<',
|
|
@@ -10846,7 +11049,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10846
11049
|
return {
|
|
10847
11050
|
left: {
|
|
10848
11051
|
column: field,
|
|
10849
|
-
table: null,
|
|
11052
|
+
table: table ?? null,
|
|
10850
11053
|
type: 'column_ref',
|
|
10851
11054
|
},
|
|
10852
11055
|
operator: '<=',
|
|
@@ -10857,7 +11060,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10857
11060
|
return {
|
|
10858
11061
|
left: {
|
|
10859
11062
|
column: field,
|
|
10860
|
-
table: null,
|
|
11063
|
+
table: table ?? null,
|
|
10861
11064
|
type: 'column_ref',
|
|
10862
11065
|
},
|
|
10863
11066
|
operator: '<>',
|
|
@@ -10873,7 +11076,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10873
11076
|
return {
|
|
10874
11077
|
type: 'binary_expr',
|
|
10875
11078
|
operator: mappedOperator,
|
|
10876
|
-
left: { type: 'column_ref', table: null, column: field },
|
|
11079
|
+
left: { type: 'column_ref', table: table ?? null, column: field },
|
|
10877
11080
|
right: { type: 'null', value: null },
|
|
10878
11081
|
};
|
|
10879
11082
|
case FieldType.Boolean:
|
|
@@ -10882,7 +11085,7 @@ export const filterToAst = (filter, db) => {
|
|
|
10882
11085
|
operator: mappedOperator,
|
|
10883
11086
|
left: {
|
|
10884
11087
|
type: 'column_ref',
|
|
10885
|
-
table: null,
|
|
11088
|
+
table: table ?? null,
|
|
10886
11089
|
column: field,
|
|
10887
11090
|
},
|
|
10888
11091
|
right: {
|