@gingkoo/pandora-metabase 1.0.158-alpha.2 → 1.0.158-alpha.21
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/lib/cjs/common/SplitView/index.js +2 -2
- package/lib/cjs/components/dialog/column-type-label/index.d.ts +8 -0
- package/lib/cjs/components/dialog/column-type-label/index.js +22 -0
- package/lib/cjs/components/dialog/column-type-label/index.less +17 -0
- package/lib/cjs/components/dialog/custom-column/config.js +2 -2
- package/lib/cjs/components/dialog/custom-column/expression-editor.js +1 -1
- package/lib/cjs/components/dialog/custom-column/expressions/suggest.js +2 -2
- package/lib/cjs/components/dialog/custom-column/expressions/tokenizer.js +2 -2
- package/lib/cjs/components/dialog/custom-column/index.js +2 -2
- package/lib/cjs/components/dialog/custom-column/tokenized-expression.js +6 -6
- package/lib/cjs/components/dialog/custom-column/tokenizedI-input.js +8 -8
- package/lib/cjs/components/dialog/custom-editor/index.js +4 -4
- package/lib/cjs/components/dialog/expression/date-format-picker.js +1 -1
- package/lib/cjs/components/dialog/expression/index.js +4 -4
- package/lib/cjs/components/dialog/formula/index.js +55 -14
- package/lib/cjs/components/dialog/formula/index.less +7 -0
- package/lib/cjs/components/dialog/formula/utils.js +5 -1
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.d.ts +3 -4
- package/lib/cjs/components/dialog/formula-list/CaseWhenGroup.js +138 -214
- package/lib/cjs/components/dialog/formula-list/LogicGroup.js +55 -39
- package/lib/cjs/components/dialog/formula-list/index.d.ts +3 -0
- package/lib/cjs/components/dialog/formula-list/index.js +414 -321
- package/lib/cjs/components/dialog/formula-list/index.less +1012 -1105
- package/lib/cjs/components/dialog/formula-list/utils.d.ts +16 -2
- package/lib/cjs/components/dialog/formula-list/utils.js +650 -131
- package/lib/cjs/components/dialog/select-column/index.js +10 -4
- package/lib/cjs/components/dialog/select-column/index.less +6 -1
- package/lib/cjs/components/dialog/select-column-multiple/index.js +12 -9
- package/lib/cjs/components/dialog/select-column-multiple/index.less +10 -0
- package/lib/cjs/components/dialog/select-join-column/index.js +9 -5
- package/lib/cjs/components/dialog/select-join-column/index.less +10 -0
- package/lib/cjs/components/dialog/select-join-column-multiple/index.js +10 -6
- package/lib/cjs/components/dialog/select-join-column-multiple/index.less +10 -0
- package/lib/cjs/components/dialog/select-permission-table/index.js +1 -1
- package/lib/cjs/components/dialog/select-summarize/index.js +2 -2
- package/lib/cjs/components/dialog/select-table/index.js +5 -5
- package/lib/cjs/components/icons.js +1 -1
- package/lib/cjs/components/metabase/index.js +129 -60
- package/lib/cjs/components/metabase/index.less +28 -29
- package/lib/cjs/components/modules/components/Wrapper.js +2 -2
- package/lib/cjs/components/modules/components/header.d.ts +2 -1
- package/lib/cjs/components/modules/components/header.js +7 -3
- package/lib/cjs/components/modules/components/item-wrapper.js +1 -1
- package/lib/cjs/components/modules/components/meta-icon.js +3 -5
- package/lib/cjs/components/modules/custom-column.js +7 -4
- package/lib/cjs/components/modules/filter.js +2 -2
- package/lib/cjs/components/modules/join-data.js +100 -21
- package/lib/cjs/components/modules/sort.js +6 -3
- package/lib/cjs/components/modules/summarize/group-by.js +10 -6
- package/lib/cjs/components/modules/summarize/select-index.js +12 -5
- package/lib/cjs/components/modules/table-data.js +50 -16
- package/lib/cjs/components/popup.js +7 -7
- package/lib/cjs/components/right-click-menu.js +3 -3
- package/lib/cjs/components/sql-syntax-confirm.d.ts +14 -0
- package/lib/cjs/components/sql-syntax-confirm.js +149 -0
- package/lib/cjs/enum.d.ts +1 -0
- package/lib/cjs/enum.js +16 -0
- package/lib/cjs/hooks/patch.js +1 -1
- package/lib/cjs/hooks/patch2.js +1 -1
- package/lib/cjs/hooks/use-state.js +118 -111
- package/lib/cjs/hooks/winsize.js +1 -1
- package/lib/cjs/index.d.ts +4 -2
- package/lib/cjs/index.js +14 -6
- package/lib/cjs/locale/en.js +35 -0
- package/lib/cjs/locale/zh.js +35 -0
- package/lib/cjs/prompt.d.ts +3 -0
- package/lib/cjs/prompt.js +262 -0
- package/lib/cjs/store/enum.d.ts +50 -0
- package/lib/cjs/store/enum.js +56 -2
- package/lib/cjs/store/helper.js +2 -2
- package/lib/cjs/store/types.d.ts +9 -52
- package/lib/cjs/store/types.js +25 -54
- package/lib/cjs/types.d.ts +6 -0
- package/lib/cjs/utils/event.js +3 -3
- package/lib/cjs/utils/helper.js +1 -1
- package/lib/cjs/utils/keydown.js +2 -2
- package/lib/cjs/utils/selection.js +1 -1
- package/lib/cjs/utils/storage.js +2 -2
- package/lib/cjs/utils/transformSql.d.ts +44 -1
- package/lib/cjs/utils/transformSql.js +1042 -29
- package/lib/cjs/utils.d.ts +3 -1
- package/lib/cjs/utils.js +82 -43
- package/lib/cjs/validate.d.ts +2 -0
- package/lib/cjs/validate.js +42 -0
- package/lib/es/components/dialog/column-type-label/index.d.ts +8 -0
- package/lib/es/components/dialog/column-type-label/index.js +16 -0
- package/lib/es/components/dialog/column-type-label/index.less +17 -0
- package/lib/es/components/dialog/expression/index.js +1 -1
- package/lib/es/components/dialog/formula/index.js +53 -12
- package/lib/es/components/dialog/formula/index.less +7 -0
- package/lib/es/components/dialog/formula/utils.js +5 -1
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.d.ts +3 -4
- package/lib/es/components/dialog/formula-list/CaseWhenGroup.js +141 -217
- package/lib/es/components/dialog/formula-list/LogicGroup.js +54 -38
- package/lib/es/components/dialog/formula-list/index.d.ts +3 -0
- package/lib/es/components/dialog/formula-list/index.js +409 -316
- package/lib/es/components/dialog/formula-list/index.less +1012 -1105
- package/lib/es/components/dialog/formula-list/utils.d.ts +16 -2
- package/lib/es/components/dialog/formula-list/utils.js +646 -126
- package/lib/es/components/dialog/select-column/index.js +7 -1
- package/lib/es/components/dialog/select-column/index.less +6 -1
- package/lib/es/components/dialog/select-column-multiple/index.js +9 -6
- package/lib/es/components/dialog/select-column-multiple/index.less +10 -0
- package/lib/es/components/dialog/select-join-column/index.js +7 -3
- package/lib/es/components/dialog/select-join-column/index.less +10 -0
- package/lib/es/components/dialog/select-join-column-multiple/index.js +7 -3
- package/lib/es/components/dialog/select-join-column-multiple/index.less +10 -0
- package/lib/es/components/metabase/index.js +126 -57
- package/lib/es/components/metabase/index.less +28 -29
- package/lib/es/components/modules/components/header.d.ts +2 -1
- package/lib/es/components/modules/components/header.js +6 -2
- package/lib/es/components/modules/components/meta-icon.js +2 -4
- package/lib/es/components/modules/custom-column.js +4 -1
- package/lib/es/components/modules/join-data.js +98 -19
- package/lib/es/components/modules/sort.js +4 -1
- package/lib/es/components/modules/summarize/group-by.js +5 -1
- package/lib/es/components/modules/summarize/select-index.js +8 -1
- package/lib/es/components/modules/table-data.js +47 -13
- package/lib/es/components/sql-syntax-confirm.d.ts +14 -0
- package/lib/es/components/sql-syntax-confirm.js +142 -0
- package/lib/es/enum.d.ts +1 -0
- package/lib/es/enum.js +1 -0
- package/lib/es/hooks/use-state.js +112 -105
- package/lib/es/index.d.ts +4 -2
- package/lib/es/index.js +8 -6
- package/lib/es/locale/en.js +35 -0
- package/lib/es/locale/zh.js +35 -0
- package/lib/es/prompt.d.ts +3 -0
- package/lib/es/prompt.js +3 -0
- package/lib/es/store/enum.d.ts +50 -0
- package/lib/es/store/enum.js +55 -1
- package/lib/es/store/types.d.ts +9 -52
- package/lib/es/store/types.js +2 -53
- package/lib/es/types.d.ts +6 -0
- package/lib/es/utils/transformSql.d.ts +44 -1
- package/lib/es/utils/transformSql.js +1038 -25
- package/lib/es/utils.d.ts +3 -1
- package/lib/es/utils.js +76 -37
- package/lib/es/validate.d.ts +2 -0
- package/lib/es/validate.js +1 -0
- package/package.json +31 -1
- package/lib/cjs/components/dialog/diff-viewer/index copy.d.ts +0 -10
- package/lib/cjs/components/dialog/diff-viewer/index copy.js +0 -139
- package/lib/es/components/dialog/diff-viewer/index copy.d.ts +0 -10
- package/lib/es/components/dialog/diff-viewer/index copy.js +0 -132
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
2
1
|
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
2
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
4
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
@@ -100,7 +99,11 @@ var useStore = function useStore() {
|
|
|
100
99
|
metaList = _useState26[0],
|
|
101
100
|
setMetaState = _useState26[1];
|
|
102
101
|
var latestMetaListRef = useRef(cloneDeep(defaultMeta));
|
|
102
|
+
var metaRevisionRef = useRef(0);
|
|
103
|
+
var metaRequestRef = useRef(0);
|
|
104
|
+
var metaEditRequestRef = useRef(0);
|
|
103
105
|
var _setMeta = useCallback(function (data) {
|
|
106
|
+
metaRevisionRef.current += 1;
|
|
104
107
|
latestMetaListRef.current = cloneDeep(data);
|
|
105
108
|
setMetaState(data);
|
|
106
109
|
}, []);
|
|
@@ -198,46 +201,50 @@ var useStore = function useStore() {
|
|
|
198
201
|
setMatchBrackets = _useState68[1];
|
|
199
202
|
var _useState69 = useState(false),
|
|
200
203
|
_useState70 = _slicedToArray(_useState69, 2),
|
|
201
|
-
|
|
202
|
-
|
|
204
|
+
pairBrackets = _useState70[0],
|
|
205
|
+
setPairBrackets = _useState70[1];
|
|
203
206
|
var _useState71 = useState(false),
|
|
204
207
|
_useState72 = _slicedToArray(_useState71, 2),
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
var _useState73 = useState(
|
|
208
|
+
hasFormulaSqlCode = _useState72[0],
|
|
209
|
+
setHasFormulaSqlCode = _useState72[1];
|
|
210
|
+
var _useState73 = useState(false),
|
|
208
211
|
_useState74 = _slicedToArray(_useState73, 2),
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
var _useState75 = useState(
|
|
212
|
+
hasFormulaDiffCode = _useState74[0],
|
|
213
|
+
setHasFormulaDiffCode = _useState74[1];
|
|
214
|
+
var _useState75 = useState([]),
|
|
212
215
|
_useState76 = _slicedToArray(_useState75, 2),
|
|
213
|
-
|
|
214
|
-
|
|
216
|
+
sourceData = _useState76[0],
|
|
217
|
+
setSourceData = _useState76[1];
|
|
215
218
|
var _useState77 = useState(false),
|
|
216
219
|
_useState78 = _slicedToArray(_useState77, 2),
|
|
217
|
-
|
|
218
|
-
|
|
220
|
+
moduleCopy = _useState78[0],
|
|
221
|
+
setModuleCopy = _useState78[1];
|
|
219
222
|
var _useState79 = useState(false),
|
|
220
223
|
_useState80 = _slicedToArray(_useState79, 2),
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
var _useState81 = useState(
|
|
224
|
+
isMetabaseCopy = _useState80[0],
|
|
225
|
+
setIsMetabaseCopy = _useState80[1];
|
|
226
|
+
var _useState81 = useState(false),
|
|
224
227
|
_useState82 = _slicedToArray(_useState81, 2),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var rightClickButtonValueMap = useRef({});
|
|
228
|
+
joinAliasConflictCheck = _useState82[0],
|
|
229
|
+
setJoinAliasConflictCheck = _useState82[1];
|
|
228
230
|
var _useState83 = useState([]),
|
|
229
231
|
_useState84 = _slicedToArray(_useState83, 2),
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
var
|
|
232
|
+
existsError = _useState84[0],
|
|
233
|
+
setExistsError = _useState84[1];
|
|
234
|
+
var rightClickButtonValueMap = useRef({});
|
|
235
|
+
var _useState85 = useState([]),
|
|
233
236
|
_useState86 = _slicedToArray(_useState85, 2),
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
var
|
|
237
|
-
var _useState87 = useState(storage._metabaseCopyModule || []),
|
|
237
|
+
rightClickMenu = _useState86[0],
|
|
238
|
+
setRightClickMenu = _useState86[1];
|
|
239
|
+
var _useState87 = useState(null),
|
|
238
240
|
_useState88 = _slicedToArray(_useState87, 2),
|
|
239
|
-
|
|
240
|
-
|
|
241
|
+
rightClickMenuState = _useState88[0],
|
|
242
|
+
setRightClickMenuState = _useState88[1];
|
|
243
|
+
var rightClickMenuClickRef = useRef();
|
|
244
|
+
var _useState89 = useState(storage._metabaseCopyModule || []),
|
|
245
|
+
_useState90 = _slicedToArray(_useState89, 2),
|
|
246
|
+
metabaseCopyModule = _useState90[0],
|
|
247
|
+
setMetabaseCopyModule = _useState90[1];
|
|
241
248
|
var setRightClickMenuClick = function setRightClickMenuClick(fn) {
|
|
242
249
|
rightClickMenuClickRef.current = fn;
|
|
243
250
|
};
|
|
@@ -493,15 +500,21 @@ var useStore = function useStore() {
|
|
|
493
500
|
}
|
|
494
501
|
return _context7.abrupt("return", tables);
|
|
495
502
|
case 1:
|
|
496
|
-
|
|
503
|
+
if (!(typeof fetchDatasetFn.current !== 'function')) {
|
|
504
|
+
_context7.next = 2;
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
return _context7.abrupt("return", []);
|
|
508
|
+
case 2:
|
|
509
|
+
_context7.next = 3;
|
|
497
510
|
return fetchDatasetFn.current(datasourceId, {
|
|
498
511
|
isExit: isExit
|
|
499
512
|
});
|
|
500
|
-
case
|
|
513
|
+
case 3:
|
|
501
514
|
_tables = _context7.sent;
|
|
502
515
|
setDataset(datasourceId, _tables);
|
|
503
516
|
return _context7.abrupt("return", _tables);
|
|
504
|
-
case
|
|
517
|
+
case 4:
|
|
505
518
|
case "end":
|
|
506
519
|
return _context7.stop();
|
|
507
520
|
}
|
|
@@ -517,7 +530,6 @@ var useStore = function useStore() {
|
|
|
517
530
|
var oldColumns,
|
|
518
531
|
callback,
|
|
519
532
|
isSelect,
|
|
520
|
-
_isSubquery,
|
|
521
533
|
_isExit,
|
|
522
534
|
_table$alias,
|
|
523
535
|
alias,
|
|
@@ -535,26 +547,29 @@ var useStore = function useStore() {
|
|
|
535
547
|
oldColumns = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : [];
|
|
536
548
|
callback = _args8.length > 3 ? _args8[3] : undefined;
|
|
537
549
|
isSelect = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : isSelectFields;
|
|
538
|
-
|
|
539
|
-
_isExit = _args8.length > 6 && _args8[6] !== undefined ? _args8[6] : isExit;
|
|
540
|
-
if (_isSubquery && oldColumns.length < 1) {
|
|
541
|
-
isSelect = false;
|
|
542
|
-
}
|
|
550
|
+
_isExit = _args8.length > 5 && _args8[5] !== undefined ? _args8[5] : isExit;
|
|
543
551
|
_table$alias = table.alias, alias = _table$alias === void 0 ? '' : _table$alias, datasourceName = table.datasourceName, did = table.datasourceId, column = table.column, extra = _objectWithoutProperties(table, _excluded);
|
|
544
552
|
tableName = table.name;
|
|
545
|
-
columns = getColumns(tableName);
|
|
553
|
+
columns = getColumns(tableName, datasourceId, _isExit);
|
|
546
554
|
if (columns.length) {
|
|
547
|
-
_context8.next =
|
|
555
|
+
_context8.next = 3;
|
|
548
556
|
break;
|
|
549
557
|
}
|
|
550
|
-
|
|
558
|
+
if (!(typeof fetchColumnsFn.current !== 'function')) {
|
|
559
|
+
_context8.next = 1;
|
|
560
|
+
break;
|
|
561
|
+
}
|
|
562
|
+
typeof callback === 'function' && callback(oldColumns);
|
|
563
|
+
return _context8.abrupt("return", oldColumns);
|
|
564
|
+
case 1:
|
|
565
|
+
_context8.next = 2;
|
|
551
566
|
return fetchColumnsFn.current(extra, datasourceId, {
|
|
552
567
|
isExit: _isExit
|
|
553
568
|
});
|
|
554
|
-
case 1:
|
|
555
|
-
columns = _context8.sent;
|
|
556
|
-
setColumns(tableName, columns);
|
|
557
569
|
case 2:
|
|
570
|
+
columns = _context8.sent;
|
|
571
|
+
setColumns(tableName, columns, datasourceId, _isExit);
|
|
572
|
+
case 3:
|
|
558
573
|
_columns = (_columns2 = columns) === null || _columns2 === void 0 ? void 0 : _columns2.map(function (v) {
|
|
559
574
|
var _ref9, _obj$fieldAlias;
|
|
560
575
|
var obj = oldColumns.find(function (oldColumn) {
|
|
@@ -568,7 +583,7 @@ var useStore = function useStore() {
|
|
|
568
583
|
});
|
|
569
584
|
});
|
|
570
585
|
typeof callback === 'function' && callback(_columns);
|
|
571
|
-
case
|
|
586
|
+
case 4:
|
|
572
587
|
case "end":
|
|
573
588
|
return _context8.stop();
|
|
574
589
|
}
|
|
@@ -582,12 +597,15 @@ var useStore = function useStore() {
|
|
|
582
597
|
var _ref0 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee9(curData, groupInd) {
|
|
583
598
|
var changeObj,
|
|
584
599
|
_metaList,
|
|
600
|
+
requestId,
|
|
601
|
+
prevRevision,
|
|
585
602
|
prevMeta,
|
|
586
603
|
newMeta,
|
|
587
604
|
oldData,
|
|
588
605
|
newData,
|
|
589
606
|
isChange,
|
|
590
|
-
_args9 = arguments
|
|
607
|
+
_args9 = arguments,
|
|
608
|
+
_t;
|
|
591
609
|
return _regeneratorRuntime.wrap(function (_context9) {
|
|
592
610
|
while (1) switch (_context9.prev = _context9.next) {
|
|
593
611
|
case 0:
|
|
@@ -599,30 +617,54 @@ var useStore = function useStore() {
|
|
|
599
617
|
}
|
|
600
618
|
return _context9.abrupt("return");
|
|
601
619
|
case 1:
|
|
620
|
+
if (changeObj !== 'init') {
|
|
621
|
+
metaEditRequestRef.current += 1;
|
|
622
|
+
}
|
|
623
|
+
requestId = ++metaRequestRef.current;
|
|
624
|
+
prevRevision = metaRevisionRef.current;
|
|
602
625
|
prevMeta = cloneDeep(_metaList || latestMetaListRef.current);
|
|
603
626
|
newMeta = cloneDeep(prevMeta);
|
|
604
627
|
if (newMeta[groupInd]) {
|
|
605
628
|
newMeta[groupInd].list = cloneDeep(curData);
|
|
606
|
-
_setMeta(newMeta);
|
|
607
629
|
}
|
|
608
630
|
if (!(changeObj === 'init')) {
|
|
609
631
|
_context9.next = 2;
|
|
610
632
|
break;
|
|
611
633
|
}
|
|
634
|
+
_setMeta(newMeta);
|
|
612
635
|
return _context9.abrupt("return");
|
|
613
636
|
case 2:
|
|
614
637
|
oldData = splitByUnion(prevMeta);
|
|
615
638
|
newData = splitByUnion(newMeta);
|
|
639
|
+
if (!(typeof fetchChangeFn.current === 'function')) {
|
|
640
|
+
_context9.next = 4;
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
616
643
|
_context9.next = 3;
|
|
617
644
|
return fetchChangeFn.current(oldData, changeObj, {
|
|
618
645
|
isExit: isExit
|
|
619
646
|
}, newData);
|
|
620
647
|
case 3:
|
|
621
|
-
|
|
622
|
-
|
|
648
|
+
_t = _context9.sent;
|
|
649
|
+
_context9.next = 5;
|
|
650
|
+
break;
|
|
651
|
+
case 4:
|
|
652
|
+
_t = true;
|
|
653
|
+
case 5:
|
|
654
|
+
isChange = _t;
|
|
655
|
+
if (!(isChange === false)) {
|
|
656
|
+
_context9.next = 6;
|
|
657
|
+
break;
|
|
658
|
+
}
|
|
659
|
+
if (requestId === metaRequestRef.current && metaRevisionRef.current === prevRevision) {
|
|
623
660
|
_setMeta(prevMeta);
|
|
624
661
|
}
|
|
625
|
-
|
|
662
|
+
return _context9.abrupt("return");
|
|
663
|
+
case 6:
|
|
664
|
+
if (requestId === metaRequestRef.current && metaRevisionRef.current === prevRevision) {
|
|
665
|
+
_setMeta(newMeta);
|
|
666
|
+
}
|
|
667
|
+
case 7:
|
|
626
668
|
case "end":
|
|
627
669
|
return _context9.stop();
|
|
628
670
|
}
|
|
@@ -633,8 +675,7 @@ var useStore = function useStore() {
|
|
|
633
675
|
};
|
|
634
676
|
}();
|
|
635
677
|
var setPreData = function setPreData(data) {
|
|
636
|
-
var
|
|
637
|
-
var _isExit = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : isExit;
|
|
678
|
+
var _isExit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : isExit;
|
|
638
679
|
if (data.length) {
|
|
639
680
|
var _metaList = data === null || data === void 0 ? void 0 : data.map(function (item, groupIndex) {
|
|
640
681
|
var _item$list;
|
|
@@ -651,7 +692,7 @@ var useStore = function useStore() {
|
|
|
651
692
|
newMeta[i].columns = columns || [];
|
|
652
693
|
}
|
|
653
694
|
setMeta(newMeta, groupIndex, 'init', data);
|
|
654
|
-
}, false,
|
|
695
|
+
}, false, _isExit);
|
|
655
696
|
return _objectSpread({}, v);
|
|
656
697
|
}
|
|
657
698
|
if ((_v$table2 = v.table) !== null && _v$table2 !== void 0 && _v$table2.datasourceId) {
|
|
@@ -661,7 +702,7 @@ var useStore = function useStore() {
|
|
|
661
702
|
newMeta[i].columns = columns || [];
|
|
662
703
|
}
|
|
663
704
|
setMeta(newMeta, groupIndex, 'init', data);
|
|
664
|
-
}, false,
|
|
705
|
+
}, false, _isExit);
|
|
665
706
|
return _objectSpread({}, v);
|
|
666
707
|
}
|
|
667
708
|
return _objectSpread({}, v);
|
|
@@ -884,57 +925,8 @@ var useStore = function useStore() {
|
|
|
884
925
|
}
|
|
885
926
|
return item;
|
|
886
927
|
};
|
|
887
|
-
var
|
|
888
|
-
var _metaList$groupIndex;
|
|
889
|
-
if (!objList || objList.length === 0) return {
|
|
890
|
-
hasConflict: false
|
|
891
|
-
};
|
|
892
|
-
var groupList = ((_metaList$groupIndex = metaList[groupIndex]) === null || _metaList$groupIndex === void 0 ? void 0 : _metaList$groupIndex.list) || [];
|
|
893
|
-
var getJoinKey = function getJoinKey(table1, table2) {
|
|
894
|
-
return "".concat((table1 === null || table1 === void 0 ? void 0 : table1.id) || '', "_").concat((table2 === null || table2 === void 0 ? void 0 : table2.id) || '', "_").concat((table2 === null || table2 === void 0 ? void 0 : table2.name) || '');
|
|
895
|
-
};
|
|
896
|
-
var existingJoinKeys = new Set();
|
|
897
|
-
groupList.forEach(function (item) {
|
|
898
|
-
if (item.type === TypeEnum.joinData && item.table1 && item.table2) {
|
|
899
|
-
existingJoinKeys.add(getJoinKey(item.table1, item.table2));
|
|
900
|
-
}
|
|
901
|
-
});
|
|
902
|
-
var _iterator = _createForOfIteratorHelper(objList),
|
|
903
|
-
_step;
|
|
904
|
-
try {
|
|
905
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
906
|
-
var pastedItem = _step.value;
|
|
907
|
-
if (pastedItem.type !== TypeEnum.joinData || !pastedItem.table1 || !pastedItem.table2) {
|
|
908
|
-
continue;
|
|
909
|
-
}
|
|
910
|
-
var pastedKey = getJoinKey(pastedItem.table1, pastedItem.table2);
|
|
911
|
-
if (existingJoinKeys.has(pastedKey)) {
|
|
912
|
-
var _pastedItem$table, _pastedItem$table2;
|
|
913
|
-
return {
|
|
914
|
-
hasConflict: true,
|
|
915
|
-
conflictingAlias: (_pastedItem$table = pastedItem.table2) === null || _pastedItem$table === void 0 ? void 0 : _pastedItem$table.alias,
|
|
916
|
-
conflictingId: (_pastedItem$table2 = pastedItem.table2) === null || _pastedItem$table2 === void 0 ? void 0 : _pastedItem$table2.id
|
|
917
|
-
};
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
} catch (err) {
|
|
921
|
-
_iterator.e(err);
|
|
922
|
-
} finally {
|
|
923
|
-
_iterator.f();
|
|
924
|
-
}
|
|
925
|
-
return {
|
|
926
|
-
hasConflict: false
|
|
927
|
-
};
|
|
928
|
-
};
|
|
929
|
-
var addMeta = function addMeta(type, index, groupIndex, obj, onConflict) {
|
|
928
|
+
var addMeta = function addMeta(type, index, groupIndex, obj) {
|
|
930
929
|
if (snapshotMode) return false;
|
|
931
|
-
if (joinAliasConflictCheck && obj && obj.length > 0) {
|
|
932
|
-
var conflict = checkTable1Conflict(obj, index, groupIndex);
|
|
933
|
-
if (conflict.hasConflict && conflict.conflictingAlias && onConflict) {
|
|
934
|
-
onConflict(conflict.conflictingAlias);
|
|
935
|
-
return false;
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
930
|
var newMeta = metaList[groupIndex].list.slice();
|
|
939
931
|
var items = [];
|
|
940
932
|
var sharedUuidMap = {};
|
|
@@ -1004,18 +996,27 @@ var useStore = function useStore() {
|
|
|
1004
996
|
});
|
|
1005
997
|
setMeta(_metaList, groupIndex);
|
|
1006
998
|
};
|
|
999
|
+
var getColumnsCacheKey = function getColumnsCacheKey(tableId) {
|
|
1000
|
+
var datasourceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1001
|
+
var exitMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1002
|
+
return "".concat(datasourceId || '', "::").concat(tableId || '', "::").concat(exitMode ? 'exit' : 'main');
|
|
1003
|
+
};
|
|
1007
1004
|
var setColumns = function setColumns(tableId, columns) {
|
|
1005
|
+
var datasourceId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
1006
|
+
var exitMode = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
1008
1007
|
var _columns = columns === null || columns === void 0 ? void 0 : columns.map(function (v) {
|
|
1009
1008
|
return _objectSpread(_objectSpread({}, v), {}, {
|
|
1010
1009
|
fieldUuid: v.fieldUuid || uuidv4('field')
|
|
1011
1010
|
});
|
|
1012
1011
|
});
|
|
1013
1012
|
var map = _objectSpread({}, _cacheColumnsMap);
|
|
1014
|
-
map[tableId] = _columns;
|
|
1013
|
+
map[getColumnsCacheKey(tableId, datasourceId, exitMode)] = _columns;
|
|
1015
1014
|
set_cacheColumnsMap(map);
|
|
1016
1015
|
};
|
|
1017
1016
|
var getColumns = function getColumns(tableId) {
|
|
1018
|
-
|
|
1017
|
+
var datasourceId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
1018
|
+
var exitMode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
1019
|
+
return _cacheColumnsMap[getColumnsCacheKey(tableId, datasourceId, exitMode)] || [];
|
|
1019
1020
|
};
|
|
1020
1021
|
var setDataset = function setDataset(datasourceId, tables) {
|
|
1021
1022
|
var map = _objectSpread({}, _cacheSource2TableMap);
|
|
@@ -1033,6 +1034,9 @@ var useStore = function useStore() {
|
|
|
1033
1034
|
var getCurrentMetaList = function getCurrentMetaList() {
|
|
1034
1035
|
return cloneDeep(latestMetaListRef.current);
|
|
1035
1036
|
};
|
|
1037
|
+
var getMetaEditRequestId = function getMetaEditRequestId() {
|
|
1038
|
+
return metaEditRequestRef.current;
|
|
1039
|
+
};
|
|
1036
1040
|
return {
|
|
1037
1041
|
showFields: showFields,
|
|
1038
1042
|
setShowFields: setShowFields,
|
|
@@ -1078,6 +1082,7 @@ var useStore = function useStore() {
|
|
|
1078
1082
|
getDataset: getDataset,
|
|
1079
1083
|
reset: reset,
|
|
1080
1084
|
getCurrentMetaList: getCurrentMetaList,
|
|
1085
|
+
getMetaEditRequestId: getMetaEditRequestId,
|
|
1081
1086
|
setProps: setProps,
|
|
1082
1087
|
preProps: preProps.current,
|
|
1083
1088
|
showSubquery: showSubquery,
|
|
@@ -1121,6 +1126,8 @@ var useStore = function useStore() {
|
|
|
1121
1126
|
setShowFormulaDiff: setShowFormulaDiff,
|
|
1122
1127
|
matchBrackets: matchBrackets,
|
|
1123
1128
|
setMatchBrackets: setMatchBrackets,
|
|
1129
|
+
pairBrackets: pairBrackets,
|
|
1130
|
+
setPairBrackets: setPairBrackets,
|
|
1124
1131
|
hasFormulaSqlCode: hasFormulaSqlCode,
|
|
1125
1132
|
hasFormulaDiffCode: hasFormulaDiffCode,
|
|
1126
1133
|
sourceData: sourceData,
|
package/lib/es/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './locale/en';
|
|
3
3
|
import './locale/zh';
|
|
4
|
-
import type { MetabaseProps, SqlVisionBuilderRef, DatasourceType, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, FormulaSqlParseParams, FormulaSqlParseResult, FormulaSqlChatMessage, FormulaSqlTableScopeItem, FormulaSqlStreamHandlers, FormulaSqlStreamParseParams } from './types';
|
|
4
|
+
import type { MetabaseProps, SqlVisionBuilderRef, DatasourceType, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, FormulaSqlParseParams, FormulaSqlParseResult, FormulaSqlChatMessage, FormulaSqlTableScopeItem, FormulaSqlStreamHandlers, FormulaSqlStreamParseParams, SqlDialect, SqlValidationQueryKind } from './types';
|
|
5
5
|
import type { MetaListType, ToolbarType } from './store/types';
|
|
6
6
|
import { AtomsTypeEnum } from './store/types';
|
|
7
|
+
import { validateMetabaseConfig } from './utils/transformSql';
|
|
8
|
+
import type { SqlValidationIssue, SqlValidationIssueCode, SqlValidationPathItem, SqlValidationPathType, SqlValidationResult } from './utils/transformSql';
|
|
7
9
|
declare const SqlVisionBuilder: React.ForwardRefExoticComponent<MetabaseProps & React.RefAttributes<SqlVisionBuilderRef>>;
|
|
8
10
|
export default SqlVisionBuilder;
|
|
9
|
-
export { MetabaseProps, DatasourceType, MetaListType, ToolbarType, SqlVisionBuilderRef, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, FormulaSqlParseParams, FormulaSqlParseResult, FormulaSqlChatMessage, FormulaSqlTableScopeItem, FormulaSqlStreamHandlers, FormulaSqlStreamParseParams, AtomsTypeEnum, };
|
|
11
|
+
export { MetabaseProps, DatasourceType, MetaListType, ToolbarType, SqlVisionBuilderRef, MetabaseRightClickMenuItem, MetabaseRightClickMenuClickParams, FormulaSqlParseParams, FormulaSqlParseResult, FormulaSqlChatMessage, FormulaSqlTableScopeItem, FormulaSqlStreamHandlers, FormulaSqlStreamParseParams, SqlDialect, SqlValidationQueryKind, SqlValidationIssue, SqlValidationIssueCode, SqlValidationPathItem, SqlValidationPathType, SqlValidationResult, AtomsTypeEnum, validateMetabaseConfig, };
|
package/lib/es/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import Loading from './common/Loading';
|
|
|
10
10
|
import Metabase from './components/metabase';
|
|
11
11
|
import { AtomsTypeEnum } from './store/types';
|
|
12
12
|
import { reassembleByUnion, patchData, splitByUnion, normalizeLegacySummarizeForSave, normalizeAndOrStructure } from './utils';
|
|
13
|
+
import { validateMetabaseConfig } from './utils/transformSql';
|
|
13
14
|
import cloneDeep from 'lodash/cloneDeep';
|
|
14
15
|
var EMPTY_ARRAY = [];
|
|
15
16
|
var DEFAULT_TOOLBAR = ['filter', 'summarize', 'joinData', 'customColumn', 'sort', 'rowLimit'];
|
|
@@ -78,6 +79,8 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
78
79
|
showFormulaDiff = _props$showFormulaDif === void 0 ? true : _props$showFormulaDif,
|
|
79
80
|
_props$matchBrackets = props.matchBrackets,
|
|
80
81
|
matchBrackets = _props$matchBrackets === void 0 ? true : _props$matchBrackets,
|
|
82
|
+
_props$pairBrackets = props.pairBrackets,
|
|
83
|
+
pairBrackets = _props$pairBrackets === void 0 ? false : _props$pairBrackets,
|
|
81
84
|
_props$joinAliasConfl = props.joinAliasConflictCheck,
|
|
82
85
|
joinAliasConflictCheck = _props$joinAliasConfl === void 0 ? false : _props$joinAliasConfl,
|
|
83
86
|
_props$operatorList = props.operatorList,
|
|
@@ -88,9 +91,7 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
88
91
|
getColumns && store.setFetchColumnsFn(getColumns);
|
|
89
92
|
onChange && store.setFetchChangeFn(onChange);
|
|
90
93
|
getModuleDiffCode && store.setFetchDiffFn(getModuleDiffCode);
|
|
91
|
-
|
|
92
|
-
store.setFetchFormulaDiffFn(getFormulaDiffCode);
|
|
93
|
-
}, []);
|
|
94
|
+
}, [getTables, getColumns, onChange, getModuleDiffCode]);
|
|
94
95
|
useEffect(function () {
|
|
95
96
|
store.setFetchFormulaSqlFn(getFormulaSqlCode);
|
|
96
97
|
store.setFetchFormulaDiffFn(getFormulaDiffCode);
|
|
@@ -101,7 +102,7 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
101
102
|
useEffect(function () {
|
|
102
103
|
var source_value = normalizeAndOrStructure(patchData(value, constantList, formulaTemplates));
|
|
103
104
|
var _value = reassembleByUnion(source_value);
|
|
104
|
-
store.setPreData(cloneDeep(_value),
|
|
105
|
+
store.setPreData(cloneDeep(_value), isExit);
|
|
105
106
|
store.setSourceData(source_value);
|
|
106
107
|
getExistsError && store.setExistsErrorFn(getExistsError, value);
|
|
107
108
|
}, [value, constantList, formulaTemplates]);
|
|
@@ -132,11 +133,12 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
132
133
|
store.setShowFormulaSql(showFormulaSql);
|
|
133
134
|
store.setShowFormulaDiff(showFormulaDiff);
|
|
134
135
|
store.setMatchBrackets(matchBrackets);
|
|
136
|
+
store.setPairBrackets(pairBrackets);
|
|
135
137
|
store.setIsSubquery(isSubquery);
|
|
136
138
|
store.setModuleCopy(moduleCopy);
|
|
137
139
|
store.setJoinAliasConflictCheck(joinAliasConflictCheck);
|
|
138
140
|
store.setOperatorList(operatorList || EMPTY_ARRAY);
|
|
139
|
-
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, snapshotMode, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
141
|
+
}, [showFields, fieldNameTpl, tableNameTpl, toolbar, showSubquery, subShowSubquery, constantList, formulaTemplates, ignoreGroupByType, filterCustomType, isExit, tableEnableAlias, fieldEnableAlias, groupByEnableAlias, isSelectFields, tableFlat, snapshotMode, copyType, metabaseCopy, moduleDiff, showFormulaSql, showFormulaDiff, matchBrackets, pairBrackets, getFormulaSqlCode, getFormulaDiffCode, isSubquery, moduleCopy, joinAliasConflictCheck, operatorList]);
|
|
140
142
|
React.useImperativeHandle(ref, function () {
|
|
141
143
|
return {
|
|
142
144
|
reset: function reset() {
|
|
@@ -163,4 +165,4 @@ var SqlVisionBuilder = React.forwardRef(function (props, ref) {
|
|
|
163
165
|
});
|
|
164
166
|
});
|
|
165
167
|
export default SqlVisionBuilder;
|
|
166
|
-
export { AtomsTypeEnum };
|
|
168
|
+
export { AtomsTypeEnum, validateMetabaseConfig };
|
package/lib/es/locale/en.js
CHANGED
|
@@ -34,6 +34,8 @@ export default register('en', {
|
|
|
34
34
|
'SqlQueryBuilder.pickTable': 'Select data table...',
|
|
35
35
|
'SqlQueryBuilder.pickConstant': 'Select constant...',
|
|
36
36
|
'customColumn.input': 'Input',
|
|
37
|
+
'customColumn.inputList': 'Value list',
|
|
38
|
+
'customColumn.inputListPlaceholder': 'Type and press Enter to add',
|
|
37
39
|
'customColumn.numberInput': 'Number input',
|
|
38
40
|
'customColumn.addSql': 'Add SQL',
|
|
39
41
|
'customColumn.parseSql': 'Parse with AI',
|
|
@@ -200,11 +202,44 @@ export default register('en', {
|
|
|
200
202
|
'metabase.nextBtn': 'next step',
|
|
201
203
|
'metabase.nextOk': 'ok',
|
|
202
204
|
'metabase.verify': 'The table has been modified. Please select again',
|
|
205
|
+
'metabase.tableNotExists': 'The table no longer exists. Please select again',
|
|
206
|
+
'metabase.fieldNotExists': 'The field no longer exists. Please select again',
|
|
203
207
|
'metabase.verifyAliasAction': 'The table has been modified. Please select it again; click As to modify the alias',
|
|
204
208
|
'metabase.validationFailed': 'Validation failed. Do you still want to save?',
|
|
205
209
|
'metabase.validationFilter': 'The filter configuration is incorrect. Saving is prohibited!',
|
|
206
210
|
'metabase.validationFormula': 'The formula configuration is incorrect. Saving is prohibited!',
|
|
207
211
|
'metabase.validationFormulaSave': 'The formula configuration is incorrect. Do you still want to save?',
|
|
212
|
+
'metabase.validationSqlSave': 'The SQL generated from the complete configuration may not execute. Do you still want to save?',
|
|
213
|
+
'metabase.validationConfigSave': 'The configuration is incomplete. Do you still want to save?',
|
|
214
|
+
'metabase.sqlErrorEmptyQuery': 'Please finish configuring this query',
|
|
215
|
+
'metabase.sqlErrorMissingSelection': 'Something is still incomplete. Check the highlighted items',
|
|
216
|
+
'metabase.sqlErrorMissingCustomInput': 'Please choose a custom input',
|
|
217
|
+
'metabase.sqlErrorMissingField': 'Please select a field',
|
|
218
|
+
'metabase.sqlErrorEmptyOutputFields': 'Please select output fields',
|
|
219
|
+
'metabase.sqlErrorOpenNested': 'Something inside is incomplete. Open it to review',
|
|
220
|
+
'metabase.sqlErrorSelectList': 'The SELECT output list is empty or incomplete',
|
|
221
|
+
'metabase.sqlErrorScalarSelectList': 'A scalar subquery must output exactly one field',
|
|
222
|
+
'metabase.sqlErrorFrom': 'FROM is missing a valid table or subquery',
|
|
223
|
+
'metabase.sqlErrorJoin': 'JOIN is missing a table or complete ON condition',
|
|
224
|
+
'metabase.sqlErrorClause': 'A WHERE, GROUP BY, ORDER BY, or LIMIT clause is incomplete',
|
|
225
|
+
'metabase.sqlErrorDanglingOperator': 'An expression starts or ends with a dangling operator',
|
|
226
|
+
'metabase.sqlErrorUnion': 'A UNION branch is missing or its output column count does not match',
|
|
227
|
+
'metabase.sqlErrorInvalidIdentifier': 'The SQL contains a table, column, or alias that was not generated correctly',
|
|
228
|
+
'metabase.sqlErrorGeneration': 'SQL generation failed for the complete configuration',
|
|
229
|
+
'metabase.sqlErrorParentheses': 'Parentheses are not balanced',
|
|
230
|
+
'metabase.sqlErrorCase': 'The CASE expression is structurally invalid',
|
|
231
|
+
'metabase.sqlErrorCaseMissingWhen': 'CASE is missing WHEN',
|
|
232
|
+
'metabase.sqlErrorCaseMissingThen': 'CASE is missing THEN',
|
|
233
|
+
'metabase.sqlErrorCaseMissingEnd': 'CASE is missing END',
|
|
234
|
+
'metabase.sqlErrorCaseMissingValue': 'A CASE WHEN / THEN / ELSE expression is empty',
|
|
235
|
+
'metabase.sqlErrorCaseKeywordScope': 'WHEN, THEN, ELSE, and END can only appear inside CASE',
|
|
236
|
+
'metabase.sqlErrorWindow': 'Incomplete window function (missing OVER or parentheses)',
|
|
237
|
+
'metabase.sqlErrorDuplicateLogicalOperator': 'Duplicate logical operator (for example AND AND or OR OR)',
|
|
238
|
+
'metabase.sqlErrorAndOr': 'Incomplete AND / OR group (missing operator or condition)',
|
|
239
|
+
'metabase.sqlErrorUnterminatedQuote': 'Unterminated string or identifier quote',
|
|
240
|
+
'metabase.sqlErrorFormula': 'The formula configuration is incorrect',
|
|
241
|
+
'metabase.sqlErrorSubstrNegativeLength': 'The third SUBSTR argument (length) cannot be negative',
|
|
242
|
+
'metabase.sqlErrorUi': 'A field or module failed validation',
|
|
208
243
|
'metabase.prompt': 'Prompt',
|
|
209
244
|
'metabase.copy': 'Copy',
|
|
210
245
|
'metabase.copySuccess': 'Copy success',
|
package/lib/es/locale/zh.js
CHANGED
|
@@ -79,6 +79,8 @@ export default register('zh', {
|
|
|
79
79
|
'customColumn.formula': '公式',
|
|
80
80
|
'customColumn.selectFormula': '选择公式...',
|
|
81
81
|
'customColumn.input': '输入框',
|
|
82
|
+
'customColumn.inputList': '值列表',
|
|
83
|
+
'customColumn.inputListPlaceholder': '可输入回车新增下拉选项',
|
|
82
84
|
'customColumn.numberInput': '数字输入框',
|
|
83
85
|
'customColumn.addSql': '添加 SQL',
|
|
84
86
|
'customColumn.parseSql': 'AI 解析',
|
|
@@ -200,11 +202,44 @@ export default register('zh', {
|
|
|
200
202
|
'metabase.nextBtn': '下一步',
|
|
201
203
|
'metabase.nextOk': '确定',
|
|
202
204
|
'metabase.verify': '表已修改,请重新选择',
|
|
205
|
+
'metabase.tableNotExists': '表不存在,请重新选择',
|
|
206
|
+
'metabase.fieldNotExists': '字段不存在,请重新选择',
|
|
203
207
|
'metabase.verifyAliasAction': '表已修改,请重新选择;点击 As 可修改别名',
|
|
204
208
|
'metabase.validationFailed': '校验未通过,是否依然保存?',
|
|
205
209
|
'metabase.validationFilter': '过滤器配置有误,禁止保存!',
|
|
206
210
|
'metabase.validationFormula': '公式配置有误,禁止保存!',
|
|
207
211
|
'metabase.validationFormulaSave': '公式配置有误,是否依然保存?',
|
|
212
|
+
'metabase.validationSqlSave': '完整配置生成的 SQL 可能无法正常执行,是否依然保存?',
|
|
213
|
+
'metabase.validationConfigSave': '配置不完整,是否依然保存?',
|
|
214
|
+
'metabase.sqlErrorEmptyQuery': '请先配置查询',
|
|
215
|
+
'metabase.sqlErrorMissingSelection': '还有未完成的内容,请查看标红位置',
|
|
216
|
+
'metabase.sqlErrorMissingCustomInput': '请选择自定义输入',
|
|
217
|
+
'metabase.sqlErrorMissingField': '请选择字段',
|
|
218
|
+
'metabase.sqlErrorEmptyOutputFields': '请选择输出字段',
|
|
219
|
+
'metabase.sqlErrorOpenNested': '内部有未完成配置,请打开查看',
|
|
220
|
+
'metabase.sqlErrorSelectList': 'SELECT 输出字段为空或不完整',
|
|
221
|
+
'metabase.sqlErrorScalarSelectList': '标量子查询必须且只能输出一个字段',
|
|
222
|
+
'metabase.sqlErrorFrom': 'FROM 缺少有效的数据表或子查询',
|
|
223
|
+
'metabase.sqlErrorJoin': 'JOIN 缺少关联表或完整的 ON 条件',
|
|
224
|
+
'metabase.sqlErrorClause': 'WHERE、GROUP BY、ORDER BY 或 LIMIT 子句不完整',
|
|
225
|
+
'metabase.sqlErrorDanglingOperator': '表达式开头或结尾存在悬空操作符',
|
|
226
|
+
'metabase.sqlErrorUnion': 'UNION 分支缺失,或各分支输出字段数量不一致',
|
|
227
|
+
'metabase.sqlErrorInvalidIdentifier': 'SQL 中存在未正确生成的表名、字段名或别名',
|
|
228
|
+
'metabase.sqlErrorGeneration': '根据当前完整配置生成 SQL 时发生错误',
|
|
229
|
+
'metabase.sqlErrorParentheses': '括号不匹配',
|
|
230
|
+
'metabase.sqlErrorCase': 'CASE 语句结构不正确',
|
|
231
|
+
'metabase.sqlErrorCaseMissingWhen': 'CASE 语句缺少 WHEN',
|
|
232
|
+
'metabase.sqlErrorCaseMissingThen': 'CASE 语句缺少 THEN',
|
|
233
|
+
'metabase.sqlErrorCaseMissingEnd': 'CASE 语句缺少 END',
|
|
234
|
+
'metabase.sqlErrorCaseMissingValue': 'CASE 的 WHEN / THEN / ELSE 表达式未填写完整',
|
|
235
|
+
'metabase.sqlErrorCaseKeywordScope': 'WHEN、THEN、ELSE、END 只能出现在 CASE 结构中',
|
|
236
|
+
'metabase.sqlErrorWindow': '窗口函数结构不完整(缺少 OVER 或括号)',
|
|
237
|
+
'metabase.sqlErrorDuplicateLogicalOperator': '逻辑操作符重复(例如 AND AND 或 OR OR)',
|
|
238
|
+
'metabase.sqlErrorAndOr': 'AND / OR 结构不完整(缺少连接符或条件)',
|
|
239
|
+
'metabase.sqlErrorUnterminatedQuote': '字符串或标识符引号未闭合',
|
|
240
|
+
'metabase.sqlErrorFormula': '公式配置有误',
|
|
241
|
+
'metabase.sqlErrorSubstrNegativeLength': 'SUBSTR 的第三个参数(截取长度)不能为负数',
|
|
242
|
+
'metabase.sqlErrorUi': '字段或模块配置校验未通过',
|
|
208
243
|
'metabase.prompt': '提示',
|
|
209
244
|
'metabase.copy': '复制',
|
|
210
245
|
'metabase.copySuccess': '复制成功',
|