@dineug/erd-editor 4.2.0 → 5.0.0
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/README.md +208 -20
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/assertClassBrand.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/checkPrivateRedeclaration.js +6 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldGet2.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldInitSpec.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldSet2.js +7 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/appContext.js +45 -0
- package/dist/components/customElementClass.d.ts +10 -0
- package/dist/components/dictionary/Dictionary.js +584 -0
- package/dist/components/dictionary/Dictionary.styles.js +208 -0
- package/dist/components/dictionary/checkCount.js +59 -0
- package/dist/components/dictionary/checkSheet.js +121 -0
- package/dist/components/dictionary/dictionary-context-menu/DictionaryContextMenu.js +17 -0
- package/dist/components/dictionary/dictionaryCommit.js +237 -0
- package/dist/components/dictionary/dictionaryFile.js +72 -0
- package/dist/components/dictionary/dictionaryKeys.js +86 -0
- package/dist/components/dictionary/dictionaryView.js +100 -0
- package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.js +110 -0
- package/dist/components/dictionary/domain-cell-editor/DomainCellEditor.styles.js +65 -0
- package/dist/components/dictionary/domain-cell-editor/openDomainCellEditor.js +16 -0
- package/dist/components/dictionary/gridTheme.js +51 -0
- package/dist/components/dictionary/sheets.js +199 -0
- package/dist/components/diffContext.d.ts +10 -0
- package/dist/components/diffContext.js +7 -0
- package/dist/components/element-host/localeHost.d.ts +43 -0
- package/dist/components/element-host/localeHost.js +81 -0
- package/dist/components/element-host/themeHost.d.ts +30 -0
- package/dist/components/element-host/themeHost.js +101 -0
- package/dist/components/erd/Erd.d.ts +2 -0
- package/dist/components/erd/Erd.js +431 -0
- package/dist/components/erd/Erd.styles.js +12 -0
- package/dist/components/erd/automatic-table-placement/AutomaticTablePlacement.js +139 -0
- package/dist/components/erd/automatic-table-placement/AutomaticTablePlacement.styles.js +22 -0
- package/dist/components/erd/automatic-table-placement/createAutomaticTablePlacement.js +175 -0
- package/dist/components/erd/automatic-table-placement/elkPlacement.js +56 -0
- package/dist/components/erd/automatic-table-placement/flowPlacement.js +32 -0
- package/dist/components/erd/automatic-table-placement/placementActions.js +33 -0
- package/dist/components/erd/automatic-table-placement/runElkPlacement.d.ts +3 -2
- package/dist/components/erd/automatic-table-placement/runElkPlacement.js +30 -0
- package/dist/components/erd/canvas/Canvas.d.ts +8 -2
- package/dist/components/erd/canvas/Canvas.js +78 -0
- package/dist/components/erd/canvas/Canvas.styles.js +15 -0
- package/dist/components/erd/canvas/CanvasScene.d.ts +28 -3
- package/dist/components/erd/canvas/CanvasScene.js +80 -0
- package/dist/components/erd/canvas/DiffOutline.template.js +5 -0
- package/dist/components/erd/canvas/EditOverlay.js +349 -0
- package/dist/components/erd/canvas/EditOverlay.styles.js +19 -0
- package/dist/components/erd/canvas/SceneIcon.template.js +14 -0
- package/dist/components/erd/canvas/altDragDuplicate.js +16 -0
- package/dist/components/erd/canvas/column-drag-ghost/ColumnDragGhost.js +61 -0
- package/dist/components/erd/canvas/{column-drag-ghost/columnDragPointer.d.ts → columnDragPointer.d.ts} +2 -2
- package/dist/components/erd/canvas/columnDragPointer.js +30 -0
- package/dist/components/erd/canvas/drag-select/DragSelect.js +109 -0
- package/dist/components/erd/canvas/draw-relationship/DrawRelationship.js +60 -0
- package/dist/components/erd/canvas/duplicate-ghost/DuplicateGhost.js +108 -0
- package/dist/components/erd/canvas/editingLayers.d.ts +8 -0
- package/dist/components/erd/canvas/editingLayers.js +21 -0
- package/dist/components/erd/canvas/entityDrag.d.ts +2 -1
- package/dist/components/erd/canvas/entityDrag.js +42 -0
- package/dist/components/erd/canvas/high-level-table/HighLevelTable.js +82 -0
- package/dist/components/erd/canvas/highlightTransition.d.ts +6 -0
- package/dist/components/erd/canvas/highlightTransition.js +79 -0
- package/dist/components/erd/canvas/memo/Memo.js +152 -0
- package/dist/components/erd/canvas/memo/memo-sash/MemoSash.js +190 -0
- package/dist/components/erd/canvas/memo/memoCaret.js +66 -0
- package/dist/components/erd/canvas/memo/memoScroll.js +14 -0
- package/dist/components/erd/canvas/memo/memoText.js +41 -0
- package/dist/components/erd/canvas/memo/useMoveMemo.js +19 -0
- package/dist/components/erd/canvas/middleButtonPan.js +33 -0
- package/dist/components/erd/canvas/mixColor.js +23 -0
- package/dist/components/erd/canvas/readPress.d.ts +43 -0
- package/dist/components/erd/canvas/readPress.js +102 -0
- package/dist/components/erd/canvas/relationship-group/RelationshipGroup.js +26 -0
- package/dist/components/erd/canvas/relationship-group/relationship/Relationship.js +153 -0
- package/dist/components/erd/canvas/relationship-group/relationship/Relationship.template.js +75 -0
- package/dist/components/erd/canvas/relationship-group/relationship/RelationshipActionLabel.js +68 -0
- package/dist/components/erd/canvas/sceneHit.js +38 -0
- package/dist/components/erd/canvas/sceneKind.js +12 -0
- package/dist/components/erd/canvas/sceneRetention.js +20 -0
- package/dist/components/erd/canvas/sceneTokens.js +110 -0
- package/dist/components/erd/canvas/shared-drag-select/SharedDragSelect.js +35 -0
- package/dist/components/erd/canvas/shared-mouse-tracker/SharedMouseTracker.js +29 -0
- package/dist/components/erd/canvas/shared-mouse-tracker/shared-mouse-cursor/SharedMouseCursor.js +40 -0
- package/dist/components/erd/canvas/stagePressScope.d.ts +11 -0
- package/dist/components/erd/canvas/stagePressScope.js +24 -0
- package/dist/components/erd/canvas/table/Table.js +399 -0
- package/dist/components/erd/canvas/table/blankLogicalName.js +14 -0
- package/dist/components/erd/canvas/table/cellLayout.js +147 -0
- package/dist/components/erd/canvas/table/colorEdge.js +16 -0
- package/dist/components/erd/canvas/table/column/Column.d.ts +6 -1
- package/dist/components/erd/canvas/table/column/Column.js +416 -0
- package/dist/components/erd/canvas/table/dictionaryMarks.js +42 -0
- package/dist/components/erd/canvas/table/doubleClick.js +15 -0
- package/dist/components/erd/canvas/table/goToErd.js +10 -0
- package/dist/components/erd/canvas/table/useFocusTable.js +19 -0
- package/dist/components/erd/canvas/table/useMoveTable.js +21 -0
- package/dist/components/erd/canvas/table/useSharedFocusTable.js +53 -0
- package/dist/components/erd/canvas/table/useViewPin.js +21 -0
- package/dist/components/erd/canvas/table-group/TableGroup.js +141 -0
- package/dist/components/erd/canvas/table-group/TableGroupBody.js +47 -0
- package/dist/components/erd/canvas/table-group/TableGroupDropTarget.js +25 -0
- package/dist/components/erd/canvas/table-group/TableGroupSash.js +143 -0
- package/dist/components/erd/canvas/table-group/TableGroups.js +21 -0
- package/dist/components/erd/canvas/table-group/tableGroupBox.js +57 -0
- package/dist/components/erd/canvas/table-group/tableGroupNameEditor.d.ts +11 -0
- package/dist/components/erd/canvas/table-group/tableGroupNameEditor.js +9 -0
- package/dist/components/erd/canvas/table-group/titleLayout.js +31 -0
- package/dist/components/erd/canvas/useMoveEntity.d.ts +1 -1
- package/dist/components/erd/canvas/useMoveEntity.js +80 -0
- package/dist/components/erd/canvas/useSharedSelectEntity.js +28 -0
- package/dist/components/erd/content-compass/ContentCompass.js +23 -0
- package/dist/components/erd/content-compass/ContentCompass.styles.js +32 -0
- package/dist/components/erd/content-compass/compassGeometry.js +71 -0
- package/dist/components/erd/diff-viewer/DiffViewer.js +75 -0
- package/dist/components/erd/diff-viewer/DiffViewer.styles.js +28 -0
- package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.d.ts +11 -0
- package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.js +105 -0
- package/dist/components/erd/diff-viewer/{erd-viewer/ErdViewer.styles.d.ts → diff-erd-viewer/DiffErdViewer.styles.d.ts} +1 -1
- package/dist/components/erd/diff-viewer/diff-erd-viewer/DiffErdViewer.styles.js +12 -0
- package/dist/components/erd/diff-viewer/diff-tree/DiffTree.js +130 -0
- package/dist/components/erd/diff-viewer/diff-tree/DiffTree.styles.js +139 -0
- package/dist/components/erd/diff-viewer/diff-tree/diffTreeModel.js +203 -0
- package/dist/components/erd/draw-target/DrawTargetButtons.js +284 -0
- package/dist/components/erd/draw-target/DrawTargetButtons.styles.js +64 -0
- package/dist/components/erd/draw-target/drawTargetState.js +37 -0
- package/dist/components/erd/draw-target/findDrawTarget.js +22 -0
- package/dist/components/erd/draw-target/placePill.js +72 -0
- package/dist/components/erd/erd-context-menu/ErdContextMenu.d.ts +6 -0
- package/dist/components/erd/erd-context-menu/ErdContextMenu.js +306 -0
- package/dist/components/erd/erd-context-menu/menus/databaseMenus.js +51 -0
- package/dist/components/erd/erd-context-menu/menus/drawRelationshipMenus.js +48 -0
- package/dist/components/erd/erd-context-menu/menus/exportMenus.js +38 -0
- package/dist/components/erd/erd-context-menu/menus/importMenus.js +49 -0
- package/dist/components/erd/erd-context-menu/menus/nameViewMenus.d.ts +1 -10
- package/dist/components/erd/erd-context-menu/menus/nameViewMenus.js +16 -0
- package/dist/components/erd/erd-context-menu/menus/relationshipMenus.js +105 -0
- package/dist/components/erd/erd-context-menu/menus/showMenus.js +80 -0
- package/dist/components/erd/erd-context-menu/menus/tablePlacementMenus.js +42 -0
- package/dist/components/erd/erdShortcutPerformCheck.js +20 -0
- package/dist/components/erd/erdTarget.d.ts +9 -0
- package/dist/components/erd/erdTarget.js +65 -0
- package/dist/components/erd/fieldIcon.js +17 -0
- package/dist/components/erd/floating-toolbar/FloatingToolbar.d.ts +1 -5
- package/dist/components/erd/floating-toolbar/FloatingToolbar.js +105 -0
- package/dist/components/erd/floating-toolbar/FloatingToolbar.styles.d.ts +1 -6
- package/dist/components/erd/goToErdTarget.js +248 -0
- package/dist/components/erd/hitTest.d.ts +9 -0
- package/dist/components/erd/hitTest.js +115 -0
- package/dist/components/erd/minimap/Minimap.js +98 -0
- package/dist/components/erd/minimap/Minimap.styles.js +29 -0
- package/dist/components/erd/minimap/MinimapScene.js +41 -0
- package/dist/components/erd/minimap/memo/Memo.js +17 -0
- package/dist/components/erd/minimap/minimapGeometry.js +140 -0
- package/dist/components/erd/minimap/table/Table.js +22 -0
- package/dist/components/erd/minimap/table-group/TableGroup.js +22 -0
- package/dist/components/erd/minimap/useMinimapScroll.js +83 -0
- package/dist/components/erd/minimap/viewport/Viewport.js +34 -0
- package/dist/components/erd/minimap/viewport/Viewport.styles.js +17 -0
- package/dist/components/erd/nameViewOptions.d.ts +11 -0
- package/dist/components/erd/nameViewOptions.js +18 -0
- package/dist/components/erd/readerNameView.js +5 -0
- package/dist/components/erd/relationshipHighlight.d.ts +8 -3
- package/dist/components/erd/relationshipHighlight.js +32 -0
- package/dist/components/erd/table-group/TableGroupDraft.js +14 -0
- package/dist/components/erd/table-group/TableGroupDraft.styles.js +22 -0
- package/dist/components/erd/table-group/tableGroupName.d.ts +0 -9
- package/dist/components/erd/table-group/tableGroupName.js +10 -0
- package/dist/components/erd/table-group/useTableGroupDraw.js +97 -0
- package/dist/components/erd/table-properties/TableProperties.js +67 -0
- package/dist/components/erd/table-properties/TableProperties.styles.js +172 -0
- package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.js +76 -0
- package/dist/components/erd/table-properties/table-properties-indexes/TablePropertiesIndexes.styles.js +115 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.js +92 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-checkbox-column/IndexesCheckboxColumn.styles.js +70 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.js +85 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-column/IndexesColumn.styles.js +60 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.js +46 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-index/IndexesIndex.styles.js +85 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.js +30 -0
- package/dist/components/erd/table-properties/table-properties-indexes/indexes-key/IndexesKey.styles.js +62 -0
- package/dist/components/erd/table-properties/table-properties-tabs/TablePropertiesTabs.js +21 -0
- package/dist/components/erd/table-properties/table-properties-tabs/TablePropertiesTabs.styles.js +34 -0
- package/dist/components/erd/time-travel/TimeTravel.js +83 -0
- package/dist/components/erd/time-travel/TimeTravel.styles.js +42 -0
- package/dist/components/erd/useErdShortcut.js +214 -0
- package/dist/components/erd/view-controls/ToolbarCompass.template.js +10 -0
- package/dist/components/erd/view-controls/nameViewDropdown.js +107 -0
- package/dist/components/erd/view-controls/nameViewDropdown.styles.js +31 -0
- package/dist/components/erd/view-controls/viewControls.styles.d.ts +7 -0
- package/dist/components/erd/view-controls/viewControls.styles.js +75 -0
- package/dist/components/erd/view-controls/zoomControls.d.ts +9 -0
- package/dist/components/erd/view-controls/zoomControls.js +31 -0
- package/dist/components/erd/virtual-scroll/VirtualScroll.js +63 -0
- package/dist/components/erd/virtual-scroll/VirtualScroll.styles.js +48 -0
- package/dist/components/erd/virtual-scroll/useVirtualScroll.js +126 -0
- package/dist/components/erd/welcome-screen/WelcomeScreen.js +194 -0
- package/dist/components/erd/welcome-screen/WelcomeScreen.styles.js +67 -0
- package/dist/components/erd/welcome-screen/welcome-hints/WelcomeHints.js +47 -0
- package/dist/components/erd/welcome-screen/welcome-hints/WelcomeHints.styles.js +52 -0
- package/dist/components/erd/welcome-screen/welcome-hints/hintArrows.js +10 -0
- package/dist/components/erd/welcome-screen/welcomeLayout.js +65 -0
- package/dist/components/erd-editor/ErdEditor.d.ts +14 -3
- package/dist/components/erd-editor/ErdEditor.js +188 -0
- package/dist/components/erd-editor/ErdEditor.styles.js +47 -0
- package/dist/components/erd-editor/useErdEditorAttachElement.d.ts +6 -20
- package/dist/components/erd-editor/useErdEditorAttachElement.js +284 -0
- package/dist/components/erd-editor/viewportLayout.js +93 -0
- package/dist/components/erd-view/ErdView.d.ts +25 -0
- package/dist/components/erd-view/ErdView.js +125 -0
- package/dist/components/erd-view/ErdView.styles.d.ts +3 -0
- package/dist/components/erd-view/ErdView.styles.js +51 -0
- package/dist/components/erd-view/viewportMeasure.d.ts +9 -0
- package/dist/components/erd-view/viewportMeasure.js +19 -0
- package/dist/components/erd-viewer/ErdViewer.d.ts +67 -0
- package/dist/components/erd-viewer/ErdViewer.js +287 -0
- package/dist/components/erd-viewer/documentSource.d.ts +26 -0
- package/dist/components/erd-viewer/documentSource.js +39 -0
- package/dist/components/explorer/Explorer.js +40 -0
- package/dist/components/explorer/explorer-controller/ExplorerController.js +43 -0
- package/dist/components/explorer/explorer-panel/ExplorerPanel.js +207 -0
- package/dist/components/explorer/explorer-panel/ExplorerPanel.styles.js +133 -0
- package/dist/components/explorer/explorer-search/ExplorerSearch.js +119 -0
- package/dist/components/explorer/explorer-search/ExplorerSearch.styles.js +151 -0
- package/dist/components/explorer/explorerCommands.js +45 -0
- package/dist/components/explorer/explorerNavigation.js +50 -0
- package/dist/components/explorer/explorerSearch.js +298 -0
- package/dist/components/explorer/explorerTree.js +331 -0
- package/dist/components/explorer/explorerView.js +46 -0
- package/dist/components/explorer/matchTarget.d.ts +0 -7
- package/dist/components/explorer/matchTarget.js +51 -0
- package/dist/components/export-image/ExportImage.js +230 -0
- package/dist/components/export-image/ExportImage.styles.js +172 -0
- package/dist/components/export-image/exportImageActions.js +102 -0
- package/dist/components/flowCenters.js +29 -0
- package/dist/components/generator-code/GeneratorCode.d.ts +1 -0
- package/dist/components/generator-code/GeneratorCode.js +96 -0
- package/dist/components/generator-code/generator-code-context-menu/GeneratorCodeContextMenu.js +49 -0
- package/dist/components/generator-code/generator-code-context-menu/menus/columnNameCaseMenus.js +37 -0
- package/dist/components/generator-code/generator-code-context-menu/menus/languageMenus.js +115 -0
- package/dist/components/generator-code/generator-code-context-menu/menus/tableNameCaseMenus.js +37 -0
- package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.d.ts +4 -3
- package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.js +122 -0
- package/dist/components/generator-code/generator-code-options/GeneratorCodeOptions.styles.js +12 -0
- package/dist/components/generator-code/generatorCodeView.js +17 -0
- package/dist/components/generator-code/languageSettings.js +48 -0
- package/dist/components/global-styles/GlobalStyles.js +18 -0
- package/dist/components/locale-picker/LocalePicker.js +129 -0
- package/dist/components/locale-picker/LocalePicker.styles.js +112 -0
- package/dist/components/localeContext.js +8 -0
- package/dist/components/localized/Localized.js +15 -0
- package/dist/components/map-columns/MapColumnsBody.js +186 -0
- package/dist/components/map-columns/MapColumnsDialog.js +112 -0
- package/dist/components/map-columns/MapColumnsDialog.styles.js +169 -0
- package/dist/components/map-columns/mapColumnsAction.js +18 -0
- package/dist/components/map-columns/nameOf.js +8 -0
- package/dist/components/map-columns/openMapColumns.js +10 -0
- package/dist/components/primitives/button/Button.js +12 -0
- package/dist/components/primitives/button/Button.styles.js +64 -0
- package/dist/components/primitives/code-block/CodeBlock.js +94 -0
- package/dist/components/primitives/code-block/CodeBlock.styles.js +108 -0
- package/dist/components/primitives/color-picker/ColorPicker.js +333 -0
- package/dist/components/primitives/color-picker/ColorPicker.styles.js +219 -0
- package/dist/components/primitives/color-picker/colorModel.js +116 -0
- package/dist/components/primitives/color-picker/presetColors.js +25 -0
- package/dist/components/primitives/color-picker/resolveColor.js +25 -0
- package/dist/components/primitives/context-menu/ContextMenu.js +13 -0
- package/dist/components/primitives/context-menu/context-menu-content/ContextMenuContent.js +72 -0
- package/dist/components/primitives/context-menu/context-menu-content/ContextMenuContent.styles.js +19 -0
- package/dist/components/primitives/context-menu/context-menu-content/fitMenu.js +21 -0
- package/dist/components/primitives/context-menu/context-menu-item/ContextMenuItem.js +47 -0
- package/dist/components/primitives/context-menu/context-menu-item/ContextMenuItem.styles.js +22 -0
- package/dist/components/primitives/context-menu/context-menu-root/ContextMenuRoot.js +10 -0
- package/dist/components/primitives/context-menu/context-menu-root/contextMenuRootContext.js +45 -0
- package/dist/components/primitives/context-menu/context-menu-separator/ContextMenuSeparator.js +6 -0
- package/dist/components/primitives/context-menu/context-menu-separator/ContextMenuSeparator.styles.js +9 -0
- package/dist/components/primitives/context-menu/menu/Menu.js +6 -0
- package/dist/components/primitives/context-menu/menu/Menu.styles.js +21 -0
- package/dist/components/primitives/context-menu/submenu-chevron/SubmenuChevron.js +10 -0
- package/dist/components/primitives/dialog/Dialog.js +75 -0
- package/dist/components/primitives/dialog/Dialog.styles.js +35 -0
- package/dist/components/primitives/edit-input/EditInput.js +68 -0
- package/dist/components/primitives/edit-input/EditInput.styles.js +40 -0
- package/dist/components/primitives/highlighted-text/HighlightedText.js +14 -0
- package/dist/components/primitives/highlighted-text/HighlightedText.styles.js +7 -0
- package/dist/components/primitives/icon/Icon.js +38 -0
- package/dist/components/primitives/icon/Icon.styles.js +12 -0
- package/dist/components/primitives/icon/icons.js +156 -0
- package/dist/components/primitives/kbd/Kbd.js +12 -0
- package/dist/components/primitives/kbd/Kbd.styles.js +44 -0
- package/dist/components/primitives/sash/Sash.js +46 -0
- package/dist/components/primitives/sash/Sash.styles.js +23 -0
- package/dist/components/primitives/select/Select.js +6 -0
- package/dist/components/primitives/select/Select.styles.js +59 -0
- package/dist/components/primitives/separator/Separator.js +14 -0
- package/dist/components/primitives/separator/Separator.styles.js +11 -0
- package/dist/components/primitives/slider/Slider.js +42 -0
- package/dist/components/primitives/slider/Slider.styles.js +58 -0
- package/dist/components/primitives/switch/Switch.d.ts +2 -0
- package/dist/components/primitives/switch/Switch.js +11 -0
- package/dist/components/primitives/switch/Switch.styles.js +117 -0
- package/dist/components/primitives/text-input/TextInput.js +25 -0
- package/dist/components/primitives/toast/Toast.js +24 -0
- package/dist/components/primitives/toast/Toast.styles.js +87 -0
- package/dist/components/primitives/tree/Tree.js +182 -0
- package/dist/components/primitives/tree/Tree.styles.js +71 -0
- package/dist/components/primitives/tree/treeModel.js +60 -0
- package/dist/components/quick-search/QuickSearch.d.ts +11 -2
- package/dist/components/quick-search/QuickSearch.js +290 -0
- package/dist/components/quick-search/QuickSearch.styles.js +168 -0
- package/dist/components/quick-search/actions.d.ts +2 -56
- package/dist/components/quick-search/actions.js +471 -0
- package/dist/components/quick-search/documentSearch.d.ts +60 -0
- package/dist/components/quick-search/documentSearch.js +132 -0
- package/dist/components/quick-search/hangul.js +183 -0
- package/dist/components/quick-search/paletteList.js +3 -0
- package/dist/components/quick-search/paletteQuery.js +73 -0
- package/dist/components/quick-search/scopedActions.d.ts +1 -1
- package/dist/components/quick-search/scopedActions.js +115 -0
- package/dist/components/sceneInteractionContext.d.ts +27 -0
- package/dist/components/sceneInteractionContext.js +15 -0
- package/dist/components/sceneSourceContext.js +7 -0
- package/dist/components/schema-sql/SchemaSQL.js +120 -0
- package/dist/components/schema-sql/SchemaSQL.styles.js +35 -0
- package/dist/components/schema-sql/schema-sql-context-menu/SchemaSQLContextMenu.js +45 -0
- package/dist/components/schema-sql/schema-sql-context-menu/menus/bracketMenus.js +37 -0
- package/dist/components/schema-sql/schema-sql-context-menu/menus/headerMenus.js +62 -0
- package/dist/components/schema-sql/schema-sql-context-menu/menus/statementsMenus.js +41 -0
- package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.js +172 -0
- package/dist/components/schema-sql/schema-sql-options/SchemaSQLOptions.styles.js +271 -0
- package/dist/components/schema-sql/schema-sql-options/ScriptEditor.js +117 -0
- package/dist/components/schema-sql/schema-sql-options/ScriptEditor.styles.js +82 -0
- package/dist/components/schema-sql/schema-sql-options/dropWarning.js +13 -0
- package/dist/components/schema-sql/schemaSQLView.js +107 -0
- package/dist/components/settings/Settings.js +112 -0
- package/dist/components/settings/Settings.styles.d.ts +1 -0
- package/dist/components/settings/Settings.styles.js +158 -0
- package/dist/components/settings/columnTypeLabels.js +15 -0
- package/dist/components/settings/lockSettingRows.js +73 -0
- package/dist/components/settings/settings-lnb/SettingsLnb.js +24 -0
- package/dist/components/settings/settings-lnb/SettingsLnb.styles.js +37 -0
- package/dist/components/settings/settingsPage.js +15 -0
- package/dist/components/settings/shortcuts/Shortcuts.js +49 -0
- package/dist/components/settings/shortcuts/Shortcuts.styles.js +36 -0
- package/dist/components/table-view/Table.styles.js +76 -0
- package/dist/components/table-view/column/Column.styles.js +45 -0
- package/dist/components/table-view/column/column-data-type/ColumnDataType.js +93 -0
- package/dist/components/table-view/column/column-data-type/ColumnDataType.styles.js +51 -0
- package/dist/components/table-view/column/column-domain/ColumnDomain.js +77 -0
- package/dist/components/table-view/column/column-domain/domainOptions.js +20 -0
- package/dist/components/table-view/column/column-key/ColumnKey.js +24 -0
- package/dist/components/table-view/column/column-key/ColumnKey.styles.js +19 -0
- package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.js +96 -0
- package/dist/components/table-view/column/column-logical-name/ColumnLogicalName.styles.js +51 -0
- package/dist/components/table-view/column/column-not-null/ColumnNotNull.js +15 -0
- package/dist/components/table-view/column/column-not-null/ColumnNotNull.styles.js +22 -0
- package/dist/components/table-view/column/column-option/ColumnOption.js +18 -0
- package/dist/components/table-view/column/column-option/ColumnOption.styles.js +26 -0
- package/dist/components/table-view/column/columnViewText.js +23 -0
- package/dist/components/table-view/column/useColumnCell.js +117 -0
- package/dist/components/table-view/column/useHintList.js +83 -0
- package/dist/components/theme/Theme.d.ts +5 -0
- package/dist/components/theme/Theme.js +20 -0
- package/dist/components/theme-builder/ThemeBuilder.js +90 -0
- package/dist/components/theme-builder/ThemeBuilder.styles.js +100 -0
- package/dist/components/themeContext.js +7 -0
- package/dist/components/toast-container/ToastContainer.js +46 -0
- package/dist/components/toast-container/ToastContainer.styles.js +48 -0
- package/dist/components/toast-container/openStatusToast.js +28 -0
- package/dist/components/toast-container/openToastWhileRunning.js +20 -0
- package/dist/components/toolbar/Toolbar.js +120 -0
- package/dist/components/toolbar/Toolbar.styles.d.ts +1 -0
- package/dist/components/toolbar/Toolbar.styles.js +68 -0
- package/dist/components/visualization/Visualization.js +39 -0
- package/dist/components/visualization/Visualization.styles.js +16 -0
- package/dist/components/visualization/VisualizationFlow.js +44 -0
- package/dist/components/visualization/VisualizationGraph.js +109 -0
- package/dist/components/visualization/VisualizationScene.js +56 -0
- package/dist/components/visualization/captureDrag.js +15 -0
- package/dist/components/visualization/createVisualization.js +77 -0
- package/dist/components/visualization/flowLayout.js +203 -0
- package/dist/components/visualization/graph-node/GraphNode.js +80 -0
- package/dist/components/visualization/graphPan.js +26 -0
- package/dist/components/visualization/graphViewHandle.js +30 -0
- package/dist/components/visualization/particles/ParticleLayer.js +33 -0
- package/dist/components/visualization/particles/particleEdges.js +36 -0
- package/dist/components/visualization/particles/particleLoop.js +118 -0
- package/dist/components/visualization/particles/particlePath.js +146 -0
- package/dist/components/visualization/table/Table.js +50 -0
- package/dist/components/visualization/table/column/Column.js +77 -0
- package/dist/components/visualization/useViewGestures.js +82 -0
- package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.js +184 -0
- package/dist/components/visualization/visualization-toolbar/VisualizationToolbar.styles.js +24 -0
- package/dist/components/visualization/visualizationView.js +152 -0
- package/dist/components/visualization/zoomVisualization.js +31 -0
- package/dist/constants/language.js +28 -0
- package/dist/constants/layout.js +14 -0
- package/dist/constants/open.js +14 -0
- package/dist/constants/schema.js +54 -0
- package/dist/constants/sql/dataType/Databricks.js +185 -0
- package/dist/constants/sql/dataType/MSSQL.js +197 -0
- package/dist/constants/sql/dataType/MariaDB.js +349 -0
- package/dist/constants/sql/dataType/MySQL.js +285 -0
- package/dist/constants/sql/dataType/Oracle.js +209 -0
- package/dist/constants/sql/dataType/PostgreSQL.js +433 -0
- package/dist/constants/sql/dataType/SQLite.js +129 -0
- package/dist/constants/sql/dataType/Snowflake.js +221 -0
- package/dist/constants/sql/dataType/index.js +22 -0
- package/dist/constants/sql/database.js +25 -0
- package/dist/constants/tablePlacement.js +11 -0
- package/dist/constants/zoom.js +5 -0
- package/dist/engine/actions.d.ts +25 -3
- package/dist/engine/actions.js +280 -0
- package/dist/engine/clock.js +25 -0
- package/dist/engine/context.d.ts +3 -3
- package/dist/engine/context.js +10 -0
- package/dist/engine/documentJson.d.ts +16 -0
- package/dist/engine/documentJson.js +20 -0
- package/dist/engine/history.actions.js +224 -0
- package/dist/engine/history.js +72 -0
- package/dist/engine/index.js +2 -56
- package/dist/engine/modules/dictionary/actions.js +42 -0
- package/dist/engine/modules/dictionary/atom.actions.js +106 -0
- package/dist/engine/modules/dictionary/checks.js +331 -0
- package/dist/engine/modules/dictionary/derive.js +101 -0
- package/dist/engine/modules/dictionary/derivedNames.js +88 -0
- package/dist/engine/modules/dictionary/dictionaryIndex.js +112 -0
- package/dist/engine/modules/dictionary/domainLinks.js +26 -0
- package/dist/engine/modules/dictionary/domainTypes.js +72 -0
- package/dist/engine/modules/dictionary/entryWrites.js +197 -0
- package/dist/engine/modules/dictionary/generator.actions.js +217 -0
- package/dist/engine/modules/dictionary/history.js +54 -0
- package/dist/engine/modules/dictionary/membership.js +42 -0
- package/dist/engine/modules/dictionary/orderKeys.js +28 -0
- package/dist/engine/modules/dictionary/termIndex.js +42 -0
- package/dist/engine/modules/editor/actions.d.ts +5 -1
- package/dist/engine/modules/editor/actions.js +58 -0
- package/dist/engine/modules/editor/atom.actions.d.ts +19 -0
- package/dist/engine/modules/editor/atom.actions.js +584 -0
- package/dist/engine/modules/editor/generator.actions.js +761 -0
- package/dist/engine/modules/editor/history.js +37 -0
- package/dist/engine/modules/editor/state.d.ts +21 -0
- package/dist/engine/modules/editor/state.js +97 -0
- package/dist/engine/modules/editor/utils/color.js +37 -0
- package/dist/engine/modules/editor/utils/duplicate.js +234 -0
- package/dist/engine/modules/editor/utils/findRelationshipColumn.js +34 -0
- package/dist/engine/modules/editor/utils/focus.d.ts +5 -0
- package/dist/engine/modules/editor/utils/focus.js +276 -0
- package/dist/engine/modules/editor/utils/nameView.js +113 -0
- package/dist/engine/modules/editor/utils/releaseHidden.js +25 -0
- package/dist/engine/modules/editor/utils/selectRangeColumn.js +18 -0
- package/dist/engine/modules/editor/utils/selection.js +16 -0
- package/dist/engine/modules/editor/view.actions.js +134 -0
- package/dist/engine/modules/editor/view.generator.actions.js +25 -0
- package/dist/engine/modules/editor/view.js +29 -0
- package/dist/engine/modules/index/actions.js +9 -0
- package/dist/engine/modules/index/atom.actions.js +73 -0
- package/dist/engine/modules/index/generator.actions.js +25 -0
- package/dist/engine/modules/index/history.js +40 -0
- package/dist/engine/modules/index-column/actions.js +9 -0
- package/dist/engine/modules/index-column/atom.actions.js +93 -0
- package/dist/engine/modules/index-column/generator.actions.js +63 -0
- package/dist/engine/modules/index-column/history.js +55 -0
- package/dist/engine/modules/memo/actions.js +13 -0
- package/dist/engine/modules/memo/atom.actions.js +106 -0
- package/dist/engine/modules/memo/generator.actions.js +50 -0
- package/dist/engine/modules/memo/history.js +109 -0
- package/dist/engine/modules/relationship/actions.js +11 -0
- package/dist/engine/modules/relationship/atom.actions.js +103 -0
- package/dist/engine/modules/relationship/endFlags.js +32 -0
- package/dist/engine/modules/relationship/fkColumns.js +85 -0
- package/dist/engine/modules/relationship/generator.actions.js +52 -0
- package/dist/engine/modules/relationship/history.js +72 -0
- package/dist/engine/modules/relationship/hooks.js +250 -0
- package/dist/engine/modules/relationship/referenceType.js +29 -0
- package/dist/engine/modules/settings/actions.js +24 -0
- package/dist/engine/modules/settings/atom.actions.d.ts +1 -1
- package/dist/engine/modules/settings/atom.actions.js +324 -0
- package/dist/engine/modules/settings/generator.actions.d.ts +6 -0
- package/dist/engine/modules/settings/generator.actions.js +132 -0
- package/dist/engine/modules/settings/history.js +65 -0
- package/dist/engine/modules/settings/screenBaseline.d.ts +37 -0
- package/dist/engine/modules/settings/screenBaseline.js +82 -0
- package/dist/engine/modules/settings/scrollRange.js +18 -0
- package/dist/engine/modules/table/actions.js +17 -0
- package/dist/engine/modules/table/atom.actions.js +231 -0
- package/dist/engine/modules/table/generator.actions.js +351 -0
- package/dist/engine/modules/table/history.js +134 -0
- package/dist/engine/modules/table/hooks.js +12 -0
- package/dist/engine/modules/table-column/actions.js +19 -0
- package/dist/engine/modules/table-column/atom.actions.js +223 -0
- package/dist/engine/modules/table-column/generator.actions.js +165 -0
- package/dist/engine/modules/table-column/history.js +146 -0
- package/dist/engine/modules/table-column/hooks.js +33 -0
- package/dist/engine/modules/table-column/keys.js +30 -0
- package/dist/engine/modules/table-column/utils/dataType.js +71 -0
- package/dist/engine/modules/table-group/actions.js +13 -0
- package/dist/engine/modules/table-group/atom.actions.js +108 -0
- package/dist/engine/modules/table-group/generator.actions.js +158 -0
- package/dist/engine/modules/table-group/history.js +106 -0
- package/dist/engine/peer-store.js +318 -0
- package/dist/engine/presence.js +45 -0
- package/dist/engine/replication-store.js +95 -0
- package/dist/engine/rx-operators/actionsFilter.js +14 -0
- package/dist/engine/rx-operators/bufferCircuitBreaker.js +35 -0
- package/dist/engine/rx-operators/createSharedStreamActionsCompressor.js +24 -0
- package/dist/engine/rx-operators/flushOnNotifier.js +6 -0
- package/dist/engine/rx-operators/groupByStreamActions.js +32 -0
- package/dist/engine/rx-operators/ignoreTagFilter.js +17 -0
- package/dist/engine/rx-operators/lockIgnoreFilter.js +20 -0
- package/dist/engine/rx-operators/notEmptyActions.js +5 -0
- package/dist/engine/rx-operators/readonlyIgnoreFilter.d.ts +6 -1
- package/dist/engine/rx-operators/readonlyIgnoreFilter.js +23 -0
- package/dist/engine/rx-operators/readonlyScreenTag.d.ts +16 -0
- package/dist/engine/rx-operators/readonlyScreenTag.js +49 -0
- package/dist/engine/rx-operators/viewActionRedirect.js +32 -0
- package/dist/engine/rx-operators/viewIgnoreFilter.js +22 -0
- package/dist/engine/rx-store.d.ts +12 -1
- package/dist/engine/rx-store.js +158 -0
- package/dist/engine/settle.js +15 -0
- package/dist/engine/shared-store.js +114 -0
- package/dist/engine/store-hooks.js +36 -0
- package/dist/engine/store.js +39 -0
- package/dist/engine/stream-flush.js +9 -0
- package/dist/engine/tag.d.ts +5 -0
- package/dist/engine/tag.js +28 -0
- package/dist/engine/to-width.js +6 -0
- package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
- package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/erd-editor-schema/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
- package/dist/erd-editor-schema/dist/convert/v2ToV3.js +142 -0
- package/dist/erd-editor-schema/dist/dictionaryRows.js +86 -0
- package/dist/erd-editor-schema/dist/helper.js +28 -0
- package/dist/erd-editor-schema/dist/normalizeSettings.js +24 -0
- package/dist/erd-editor-schema/dist/orderKey.js +139 -0
- package/dist/erd-editor-schema/dist/parser.js +73 -0
- package/dist/erd-editor-schema/dist/query/index.js +98 -0
- package/dist/erd-editor-schema/dist/query/lww.js +38 -0
- package/dist/erd-editor-schema/dist/storageForm.js +209 -0
- package/dist/erd-editor-schema/dist/utils/bit.js +6 -0
- package/dist/erd-editor-schema/dist/v2/migrations/relationshipType.migration.js +14 -0
- package/dist/erd-editor-schema/dist/v2/parser/canvas.js +91 -0
- package/dist/erd-editor-schema/dist/v2/parser/index.js +16 -0
- package/dist/erd-editor-schema/dist/v2/parser/memo.js +40 -0
- package/dist/erd-editor-schema/dist/v2/parser/relationship.js +62 -0
- package/dist/erd-editor-schema/dist/v2/parser/table.js +125 -0
- package/dist/erd-editor-schema/dist/v2/schema/canvasEntity.js +65 -0
- package/dist/erd-editor-schema/dist/v2/schema/relationshipEntity.js +25 -0
- package/dist/erd-editor-schema/dist/v2/schema/tableEntity.js +8 -0
- package/dist/erd-editor-schema/dist/v3/parser/doc.js +29 -0
- package/dist/erd-editor-schema/dist/v3/parser/domain.entity.js +28 -0
- package/dist/erd-editor-schema/dist/v3/parser/index.entity.js +33 -0
- package/dist/erd-editor-schema/dist/v3/parser/index.js +107 -0
- package/dist/erd-editor-schema/dist/v3/parser/indexColumn.entity.js +27 -0
- package/dist/erd-editor-schema/dist/v3/parser/memo.entity.js +38 -0
- package/dist/erd-editor-schema/dist/v3/parser/migrateScroll.js +11 -0
- package/dist/erd-editor-schema/dist/v3/parser/relationship.entity.js +60 -0
- package/dist/erd-editor-schema/dist/v3/parser/settings.js +140 -0
- package/dist/erd-editor-schema/dist/v3/parser/table.entity.js +55 -0
- package/dist/erd-editor-schema/dist/v3/parser/tableColumn.entity.js +54 -0
- package/dist/erd-editor-schema/dist/v3/parser/tableGroup.entity.js +37 -0
- package/dist/erd-editor-schema/dist/v3/parser/term.entity.js +30 -0
- package/dist/erd-editor-schema/dist/v3/parser/word.entity.js +32 -0
- package/dist/erd-editor-schema/dist/v3/schema/index.js +46 -0
- package/dist/erd-editor-schema/dist/v3/schema/indexColumn.entity.js +8 -0
- package/dist/erd-editor-schema/dist/v3/schema/relationship.entity.js +31 -0
- package/dist/erd-editor-schema/dist/v3/schema/settings.js +141 -0
- package/dist/erd-editor-schema/dist/v3/schema/tableColumn.entity.js +14 -0
- package/dist/erd-editor.d.ts +2 -0
- package/dist/erd-editor.js +4 -0
- package/dist/erd-editor.umd.js +789 -750
- package/dist/erd-viewer.d.ts +2 -0
- package/dist/erd-viewer.js +4 -0
- package/dist/erd-viewer.umd.js +696 -0
- package/dist/grid/dist/Grid.js +511 -0
- package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
- package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/grid/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
- package/dist/grid/dist/font.js +58 -0
- package/dist/grid/dist/input/editing.js +460 -0
- package/dist/grid/dist/input/pointer.js +426 -0
- package/dist/grid/dist/model/columns.js +41 -0
- package/dist/grid/dist/model/editing.js +93 -0
- package/dist/grid/dist/model/keys.js +89 -0
- package/dist/grid/dist/model/selection.js +237 -0
- package/dist/grid/dist/model/text.js +122 -0
- package/dist/grid/dist/model/tsv.js +108 -0
- package/dist/grid/dist/model/viewport.js +75 -0
- package/dist/grid/dist/scene/GridScene.js +64 -0
- package/dist/grid/dist/scene/draw/cells.js +61 -0
- package/dist/grid/dist/scene/draw/context.js +17 -0
- package/dist/grid/dist/scene/draw/headers.js +48 -0
- package/dist/grid/dist/scene/draw/scrollbar.js +70 -0
- package/dist/grid/dist/scene/layout.js +62 -0
- package/dist/grid/dist/scene/overlay.js +144 -0
- package/dist/grid/dist/scene/paint.js +123 -0
- package/dist/grid/dist/scene/state.js +269 -0
- package/dist/grid/dist/theme.js +37 -0
- package/dist/hooks/useDarkMode.d.ts +2 -0
- package/dist/hooks/useDarkMode.js +35 -0
- package/dist/hooks/useFlipAnimation.js +10 -0
- package/dist/hooks/useKeyBindingMap.js +55 -0
- package/dist/hooks/useNavigatorLanguages.js +22 -0
- package/dist/hooks/usePinchZoom.d.ts +6 -1
- package/dist/hooks/usePinchZoom.js +60 -0
- package/dist/hooks/useUnmounted.js +16 -0
- package/dist/hooks/useViewShortcut.d.ts +14 -0
- package/dist/hooks/useViewShortcut.js +34 -0
- package/dist/i18n/loadMessages.d.ts +12 -0
- package/dist/i18n/loadMessages.js +40 -0
- package/dist/i18n/locales.js +145 -0
- package/dist/i18n/menuLabel.js +4 -0
- package/dist/i18n/messages/ar-SA.d.ts +2 -3
- package/dist/i18n/messages/ar-SA.js +550 -0
- package/dist/i18n/messages/de-DE.d.ts +2 -3
- package/dist/i18n/messages/de-DE.js +498 -0
- package/dist/i18n/messages/en/code.js +13 -0
- package/dist/i18n/messages/en/colorPicker.js +36 -0
- package/dist/i18n/messages/en/common.js +76 -0
- package/dist/i18n/messages/en/contextMenu.js +31 -0
- package/dist/i18n/messages/en/dictionary.js +76 -0
- package/dist/i18n/messages/en/explorer.js +38 -0
- package/dist/i18n/messages/en/exportImage.js +23 -0
- package/dist/i18n/messages/en/feedback.js +9 -0
- package/dist/i18n/messages/en/findReplace.js +43 -0
- package/dist/i18n/messages/en/floatingToolbar.js +13 -0
- package/dist/i18n/messages/en/index.d.ts +2 -3
- package/dist/i18n/messages/en/index.js +47 -0
- package/dist/i18n/messages/en/mapColumns.js +36 -0
- package/dist/i18n/messages/en/palette.js +36 -0
- package/dist/i18n/messages/en/schemaSql.js +27 -0
- package/dist/i18n/messages/en/settings.d.ts +0 -3
- package/dist/i18n/messages/en/settings.js +18 -0
- package/dist/i18n/messages/en/shortcuts.js +35 -0
- package/dist/i18n/messages/en/tableProperties.js +35 -0
- package/dist/i18n/messages/en/themeBuilder.js +8 -0
- package/dist/i18n/messages/en/toolbar.js +9 -0
- package/dist/i18n/messages/en/viewer.d.ts +6 -0
- package/dist/i18n/messages/en/viewer.js +7 -0
- package/dist/i18n/messages/en/visualization.js +15 -0
- package/dist/i18n/messages/en/welcome.js +14 -0
- package/dist/i18n/messages/es-ES.d.ts +2 -3
- package/dist/i18n/messages/es-ES.js +511 -0
- package/dist/i18n/messages/eu-ES.d.ts +2 -3
- package/dist/i18n/messages/eu-ES.js +498 -0
- package/dist/i18n/messages/fa-IR.d.ts +2 -3
- package/dist/i18n/messages/fa-IR.js +498 -0
- package/dist/i18n/messages/fr-FR.d.ts +2 -3
- package/dist/i18n/messages/fr-FR.js +511 -0
- package/dist/i18n/messages/he-IL.d.ts +2 -3
- package/dist/i18n/messages/he-IL.js +511 -0
- package/dist/i18n/messages/id-ID.d.ts +2 -3
- package/dist/i18n/messages/id-ID.js +459 -0
- package/dist/i18n/messages/index.d.ts +3 -3
- package/dist/i18n/messages/index.js +58 -0
- package/dist/i18n/messages/it-IT.d.ts +2 -3
- package/dist/i18n/messages/it-IT.js +511 -0
- package/dist/i18n/messages/ja-JP.d.ts +2 -3
- package/dist/i18n/messages/ja-JP.js +459 -0
- package/dist/i18n/messages/ko-KR.d.ts +2 -3
- package/dist/i18n/messages/ko-KR.js +459 -0
- package/dist/i18n/messages/nl-NL.d.ts +2 -3
- package/dist/i18n/messages/nl-NL.js +498 -0
- package/dist/i18n/messages/pl-PL.d.ts +2 -3
- package/dist/i18n/messages/pl-PL.js +524 -0
- package/dist/i18n/messages/pt-BR.d.ts +2 -3
- package/dist/i18n/messages/pt-BR.js +511 -0
- package/dist/i18n/messages/pt-PT.d.ts +2 -3
- package/dist/i18n/messages/pt-PT.js +511 -0
- package/dist/i18n/messages/ro-RO.d.ts +2 -3
- package/dist/i18n/messages/ro-RO.js +511 -0
- package/dist/i18n/messages/ru-RU.d.ts +2 -3
- package/dist/i18n/messages/ru-RU.js +524 -0
- package/dist/i18n/messages/sk-SK.d.ts +2 -3
- package/dist/i18n/messages/sk-SK.js +524 -0
- package/dist/i18n/messages/sl-SI.d.ts +2 -3
- package/dist/i18n/messages/sl-SI.js +524 -0
- package/dist/i18n/messages/sv-SE.d.ts +2 -3
- package/dist/i18n/messages/sv-SE.js +498 -0
- package/dist/i18n/messages/tr-TR.d.ts +2 -3
- package/dist/i18n/messages/tr-TR.js +498 -0
- package/dist/i18n/messages/uk-UA.d.ts +2 -3
- package/dist/i18n/messages/uk-UA.js +524 -0
- package/dist/i18n/messages/zh-CN.d.ts +2 -3
- package/dist/i18n/messages/zh-CN.js +459 -0
- package/dist/i18n/messages/zh-TW.d.ts +2 -3
- package/dist/i18n/messages/zh-TW.js +459 -0
- package/dist/i18n/resolveLocale.js +28 -0
- package/dist/i18n/source.js +6 -0
- package/dist/i18n/translate.js +34 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -48293
- package/dist/konva/scene/columnDropTarget.js +43 -0
- package/dist/konva/scene/contentBounds.js +48 -0
- package/dist/konva/scene/fitZoom.d.ts +7 -0
- package/dist/konva/scene/fitZoom.js +31 -0
- package/dist/konva/scene/konvaFlip.js +125 -0
- package/dist/konva/scene/metrics.js +59 -0
- package/dist/konva/scene/renderScene.js +37 -0
- package/dist/konva/scene/stacking.js +13 -0
- package/dist/konva/scene/viewFreeze.js +29 -0
- package/dist/konva/scene/viewLayout.js +171 -0
- package/dist/konva/scene/viewport.js +86 -0
- package/dist/konva/testHandle.d.ts +9 -3
- package/dist/konva/testHandle.js +5 -0
- package/dist/konva/theme.js +45 -0
- package/dist/peer/index.js +35 -235
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/assertClassBrand.js +7 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/checkPrivateRedeclaration.js +6 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldGet2.js +7 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldInitSpec.js +7 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/classPrivateFieldSet2.js +7 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/defineProperty.js +12 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/r-html/dist/_virtual/_@oxc-project_runtime@0.151.0/helpers/esm/typeof.js +11 -0
- package/dist/r-html/dist/constants.js +36 -0
- package/dist/r-html/dist/context/createContext.js +49 -0
- package/dist/r-html/dist/context/useContext.js +28 -0
- package/dist/r-html/dist/context/useProvider.js +41 -0
- package/dist/r-html/dist/css/compile.js +27 -0
- package/dist/r-html/dist/css/diagnostics.js +195 -0
- package/dist/r-html/dist/css/element.js +34 -0
- package/dist/r-html/dist/css/emit.js +26 -0
- package/dist/r-html/dist/css/flatten.js +76 -0
- package/dist/r-html/dist/css/hash.js +15 -0
- package/dist/r-html/dist/css/index.js +31 -0
- package/dist/r-html/dist/css/selector.js +11 -0
- package/dist/r-html/dist/helpers/array.js +9 -0
- package/dist/r-html/dist/helpers/fn.js +14 -0
- package/dist/r-html/dist/helpers/is-type.js +16 -0
- package/dist/r-html/dist/helpers/subject.js +21 -0
- package/dist/r-html/dist/observable/index.js +78 -0
- package/dist/r-html/dist/observable/scheduler.js +84 -0
- package/dist/r-html/dist/parser/html/helper.js +58 -0
- package/dist/r-html/dist/parser/html/index.js +101 -0
- package/dist/r-html/dist/parser/html/tokenizer.js +161 -0
- package/dist/r-html/dist/parser/vNode.js +32 -0
- package/dist/r-html/dist/render/directives/attribute/ref.js +18 -0
- package/dist/r-html/dist/render/directives/attributeDirective.js +7 -0
- package/dist/r-html/dist/render/directives/index.js +13 -0
- package/dist/r-html/dist/render/directives/node/cache.js +56 -0
- package/dist/r-html/dist/render/directives/node/innerHTML.js +20 -0
- package/dist/r-html/dist/render/directives/node/repeat.js +124 -0
- package/dist/r-html/dist/render/directives/nodeDirective.js +15 -0
- package/dist/r-html/dist/render/domAdapter.js +74 -0
- package/dist/r-html/dist/render/helper.js +91 -0
- package/dist/r-html/dist/render/hmr.js +64 -0
- package/dist/r-html/dist/render/host.js +16 -0
- package/dist/r-html/dist/render/hostTemplate.js +35 -0
- package/dist/r-html/dist/render/index.js +9 -0
- package/dist/r-html/dist/render/part/attribute/attribute.js +102 -0
- package/dist/r-html/dist/render/part/attribute/boolean.js +33 -0
- package/dist/r-html/dist/render/part/attribute/directive.js +48 -0
- package/dist/r-html/dist/render/part/attribute/event.js +49 -0
- package/dist/r-html/dist/render/part/attribute/index.js +12 -0
- package/dist/r-html/dist/render/part/attribute/property.js +30 -0
- package/dist/r-html/dist/render/part/attribute/spread.js +28 -0
- package/dist/r-html/dist/render/part/container.js +64 -0
- package/dist/r-html/dist/render/part/index.js +32 -0
- package/dist/r-html/dist/render/part/node/comment.js +34 -0
- package/dist/r-html/dist/render/part/node/component/hooks.js +28 -0
- package/dist/r-html/dist/render/part/node/component/index.js +37 -0
- package/dist/r-html/dist/render/part/node/component/observableComponent.js +111 -0
- package/dist/r-html/dist/render/part/node/component/prop.js +30 -0
- package/dist/r-html/dist/render/part/node/component/webComponent/helper.js +19 -0
- package/dist/r-html/dist/render/part/node/component/webComponent/index.js +79 -0
- package/dist/r-html/dist/render/part/node/text/array.js +87 -0
- package/dist/r-html/dist/render/part/node/text/arrayDiff.js +90 -0
- package/dist/r-html/dist/render/part/node/text/directive.js +51 -0
- package/dist/r-html/dist/render/part/node/text/function.js +7 -0
- package/dist/r-html/dist/render/part/node/text/helper.js +55 -0
- package/dist/r-html/dist/render/part/node/text/index.js +54 -0
- package/dist/r-html/dist/render/part/node/text/node.js +25 -0
- package/dist/r-html/dist/render/part/node/text/object.js +60 -0
- package/dist/r-html/dist/render/part/node/text/primitive.js +26 -0
- package/dist/r-html/dist/render/part/node/text/templateLiterals.js +38 -0
- package/dist/r-html/dist/render/value.js +8 -0
- package/dist/r-html/dist/store/index.js +72 -0
- package/dist/r-html/dist/template/css.js +70 -0
- package/dist/r-html/dist/template/cssDiagnostics.js +23 -0
- package/dist/r-html/dist/template/cssSource.js +62 -0
- package/dist/r-html/dist/template/helper.js +37 -0
- package/dist/r-html/dist/template/html.js +29 -0
- package/dist/r-html/dist/template/index.js +13 -0
- package/dist/r-html/dist/template/tNode.js +107 -0
- package/dist/r-html/dist/template/vCSSStyleSheet.js +162 -0
- package/dist/r-html-konva/dist/batchDraw.js +90 -0
- package/dist/r-html-konva/dist/host.js +336 -0
- package/dist/schema-sql-parser/dist/parser/dataType/Databricks.js +50 -0
- package/dist/schema-sql-parser/dist/parser/dataType/MSSQL.js +53 -0
- package/dist/schema-sql-parser/dist/parser/dataType/MariaDB.js +91 -0
- package/dist/schema-sql-parser/dist/parser/dataType/MySQL.js +75 -0
- package/dist/schema-sql-parser/dist/parser/dataType/Oracle.js +56 -0
- package/dist/schema-sql-parser/dist/parser/dataType/PostgreSQL.js +112 -0
- package/dist/schema-sql-parser/dist/parser/dataType/SQLite.js +36 -0
- package/dist/schema-sql-parser/dist/parser/dataType/Snowflake.js +59 -0
- package/dist/schema-sql-parser/dist/parser/helper.js +701 -0
- package/dist/schema-sql-parser/dist/parser/index.js +70 -0
- package/dist/schema-sql-parser/dist/parser/statement/add.extended.property.js +73 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.default.js +75 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.foreignKey.js +69 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.primaryKey.js +86 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.add.unique.js +128 -0
- package/dist/schema-sql-parser/dist/parser/statement/alter.table.alter.column.js +90 -0
- package/dist/schema-sql-parser/dist/parser/statement/comment.on.column.js +56 -0
- package/dist/schema-sql-parser/dist/parser/statement/comment.on.table.js +52 -0
- package/dist/schema-sql-parser/dist/parser/statement/create.index.js +61 -0
- package/dist/schema-sql-parser/dist/parser/statement/create.table.js +549 -0
- package/dist/schema-sql-parser/dist/parser/statement/default.expression.js +206 -0
- package/dist/schema-sql-parser/dist/parser/statement/index.columns.js +49 -0
- package/dist/schema-sql-parser/dist/parser/statement/index.js +25 -0
- package/dist/schema-sql-parser/dist/parser/tokenizer.js +241 -0
- package/dist/services/elk-layout/elkGraph.js +184 -0
- package/dist/services/elk-layout/elkLayoutOptions.js +52 -0
- package/dist/services/elk-layout/index.js +45 -0
- package/dist/services/export-png/ExportScene.js +30 -0
- package/dist/services/export-png/documentScene.js +45 -0
- package/dist/services/export-png/exportBox.js +63 -0
- package/dist/services/export-png/exportTheme.js +16 -0
- package/dist/services/export-png/index.js +139 -0
- package/dist/services/export-png/pixelRatio.js +12 -0
- package/dist/services/export-png/renderPng.js +52 -0
- package/dist/services/export-png/renderSvg.js +24 -0
- package/dist/services/export-png/sceneSvg.js +315 -0
- package/dist/services/export-png/textWidth.js +12 -0
- package/dist/services/export-png/toImage.d.ts +27 -0
- package/dist/services/export-png/toImage.js +49 -0
- package/dist/services/shiki/index.js +24 -0
- package/dist/styles/elevation.styles.js +9 -0
- package/dist/styles/fonts.styles.js +12 -0
- package/dist/styles/reset.styles.js +104 -0
- package/dist/styles/scrollbar.styles.js +27 -0
- package/dist/styles/typography.styles.js +63 -0
- package/dist/themes/radix-ui-theme.config.js +133 -0
- package/dist/themes/radix-ui-theme.js +231 -0
- package/dist/themes/tokens.js +107 -0
- package/dist/utils/arrayHas.js +7 -0
- package/dist/utils/attribute.js +11 -0
- package/dist/utils/bit.js +6 -0
- package/dist/utils/calcMemo.js +9 -0
- package/dist/utils/calcTable.js +220 -0
- package/dist/utils/clickGesture.js +33 -0
- package/dist/utils/clipboard.js +45 -0
- package/dist/utils/collection/domain.entity.js +13 -0
- package/dist/utils/collection/index.entity.js +13 -0
- package/dist/utils/collection/indexColumn.entity.js +12 -0
- package/dist/utils/collection/memo.entity.js +18 -0
- package/dist/utils/collection/relationship.entity.js +28 -0
- package/dist/utils/collection/sequence.js +21 -0
- package/dist/utils/collection/table.entity.js +24 -0
- package/dist/utils/collection/tableColumn.entity.js +25 -0
- package/dist/utils/collection/tableGroup.entity.js +17 -0
- package/dist/utils/collection/term.entity.js +14 -0
- package/dist/utils/collection/word.entity.js +15 -0
- package/dist/utils/contrastText.js +26 -0
- package/dist/utils/deepMerge.js +24 -0
- package/dist/utils/device-detect/index.js +6 -0
- package/dist/utils/dictionary-csv/csv.js +61 -0
- package/dist/utils/dictionary-csv/decode.js +10 -0
- package/dist/utils/dictionary-csv/dictionaryCsv.js +150 -0
- package/dist/utils/diff/compareEntities.js +200 -0
- package/dist/{components/erd/diff-viewer → utils/diff}/diff.d.ts +1 -1
- package/dist/utils/diff/diff.js +29 -0
- package/dist/utils/diff/diffDocuments.js +224 -0
- package/dist/utils/diff/pairEntities.js +71 -0
- package/dist/utils/diff/types.d.ts +1 -1
- package/dist/utils/diff/types.js +38 -0
- package/dist/utils/domEvent.js +55 -0
- package/dist/utils/dragSelect.js +9 -0
- package/dist/utils/draw-relationship/bezier.js +44 -0
- package/dist/utils/draw-relationship/calc.js +91 -0
- package/dist/utils/draw-relationship/corner.js +60 -0
- package/dist/utils/draw-relationship/draw.js +194 -0
- package/dist/utils/draw-relationship/incremental.d.ts +4 -4
- package/dist/utils/draw-relationship/incremental.js +135 -0
- package/dist/utils/draw-relationship/index.d.ts +16 -1
- package/dist/utils/draw-relationship/index.js +198 -0
- package/dist/utils/draw-relationship/loop.js +25 -0
- package/dist/utils/draw-relationship/nudge.js +402 -0
- package/dist/utils/draw-relationship/pathFinding.js +277 -0
- package/dist/utils/draw-relationship/route.d.ts +12 -0
- package/dist/utils/draw-relationship/route.js +460 -0
- package/dist/utils/draw-relationship/search.d.ts +15 -0
- package/dist/utils/draw-relationship/search.js +294 -0
- package/dist/utils/draw-relationship/sort.js +370 -0
- package/dist/utils/draw-relationship/stub.js +46 -0
- package/dist/utils/emitter.d.ts +15 -0
- package/dist/utils/emitter.js +76 -0
- package/dist/utils/file/exportFile.js +52 -0
- package/dist/utils/file/importFile.js +201 -0
- package/dist/utils/file/importSchema.js +128 -0
- package/dist/utils/find-replace/findMatches.js +212 -0
- package/dist/utils/find-replace/index.d.ts +0 -1
- package/dist/utils/find-replace/matcher.js +128 -0
- package/dist/utils/find-replace/present.js +48 -0
- package/dist/utils/find-replace/preserveCase.js +25 -0
- package/dist/utils/find-replace/replaceActions.js +70 -0
- package/dist/utils/flipAnimation.js +52 -0
- package/dist/utils/focus.js +40 -0
- package/dist/utils/formatCount.js +12 -0
- package/dist/utils/generator-code/aml.js +199 -0
- package/dist/utils/generator-code/columnTypes.js +369 -0
- package/dist/utils/generator-code/csharp.js +230 -0
- package/dist/utils/generator-code/dbml.js +248 -0
- package/dist/utils/generator-code/doctrine.js +964 -0
- package/dist/utils/generator-code/doctrineReservedWords.js +57 -0
- package/dist/utils/generator-code/drizzle.js +1853 -0
- package/dist/utils/generator-code/go.js +160 -0
- package/dist/utils/generator-code/graphql.js +347 -0
- package/dist/utils/generator-code/heck.js +47 -0
- package/dist/utils/generator-code/index.js +179 -0
- package/dist/utils/generator-code/java.js +179 -0
- package/dist/utils/generator-code/jpa.js +218 -0
- package/dist/utils/generator-code/jsonSchema.js +402 -0
- package/dist/utils/generator-code/jsonShape.js +169 -0
- package/dist/utils/generator-code/kotlin.js +102 -0
- package/dist/utils/generator-code/mermaid.js +130 -0
- package/dist/utils/generator-code/php.js +211 -0
- package/dist/utils/generator-code/rust.js +143 -0
- package/dist/utils/generator-code/rustTypes.js +132 -0
- package/dist/utils/generator-code/scala.js +124 -0
- package/dist/utils/generator-code/seaorm.js +581 -0
- package/dist/utils/generator-code/sequelize.js +1225 -0
- package/dist/utils/generator-code/sqlalchemy.js +1250 -0
- package/dist/utils/generator-code/swift.js +222 -0
- package/dist/utils/generator-code/typeorm.js +998 -0
- package/dist/utils/generator-code/typescript.js +67 -0
- package/dist/utils/generator-code/utils.js +87 -0
- package/dist/utils/generator-code/zod.js +106 -0
- package/dist/utils/globalEventObservable.js +67 -0
- package/dist/utils/highlightWords.js +48 -0
- package/dist/utils/icon.js +35 -0
- package/dist/utils/index.js +26 -0
- package/dist/utils/internalEvents.js +26 -0
- package/dist/utils/keyboard-shortcut/bindKeys.js +30 -0
- package/dist/utils/keyboard-shortcut/index.d.ts +7 -1
- package/dist/utils/keyboard-shortcut/index.js +243 -0
- package/dist/utils/keyboard-shortcut/utils.js +32 -0
- package/dist/utils/loadValue.js +11 -0
- package/dist/utils/map-columns/alignTypes.js +48 -0
- package/dist/utils/map-columns/buildRows.js +337 -0
- package/dist/utils/map-columns/candidateKeys.js +24 -0
- package/dist/utils/map-columns/mapping.js +41 -0
- package/dist/utils/map-columns/prefill.js +32 -0
- package/dist/utils/map-columns/toMapColumnsActions.js +63 -0
- package/dist/utils/map-columns/validate.js +81 -0
- package/dist/utils/memo.js +6 -0
- package/dist/utils/pinch.d.ts +5 -1
- package/dist/utils/pinch.js +99 -0
- package/dist/utils/promise.js +16 -0
- package/dist/utils/referentialAction.js +23 -0
- package/dist/utils/rx-operators/fromCopy.js +7 -0
- package/dist/utils/rx-operators/fromPaste.js +7 -0
- package/dist/utils/rx-operators/fromShadowDraggable.js +5 -0
- package/dist/utils/safeCallback.js +10 -0
- package/dist/utils/schema-aml-parser/convert.js +285 -0
- package/dist/utils/schema-aml-parser/dataType.js +57 -0
- package/dist/utils/schema-aml-parser/index.js +22 -0
- package/dist/utils/schema-aml-parser/parser.js +637 -0
- package/dist/utils/schema-aml-parser/tokenizer.js +208 -0
- package/dist/utils/schema-aml-parser/types.js +8 -0
- package/dist/utils/schema-dbml-parser/convert.js +324 -0
- package/dist/utils/schema-dbml-parser/dataType.js +32 -0
- package/dist/utils/schema-dbml-parser/index.js +23 -0
- package/dist/utils/schema-dbml-parser/parser.js +646 -0
- package/dist/utils/schema-dbml-parser/tokenizer.js +185 -0
- package/dist/utils/schema-graphql-parser/convert.js +410 -0
- package/dist/utils/schema-graphql-parser/dataType.js +228 -0
- package/dist/utils/schema-graphql-parser/index.js +23 -0
- package/dist/utils/schema-graphql-parser/parser.js +490 -0
- package/dist/utils/schema-sql/Databricks.js +158 -0
- package/dist/utils/schema-sql/MSSQL.js +214 -0
- package/dist/utils/schema-sql/MariaDB.js +143 -0
- package/dist/utils/schema-sql/MySQL.js +224 -0
- package/dist/utils/schema-sql/Oracle.js +236 -0
- package/dist/utils/schema-sql/PostgreSQL.js +179 -0
- package/dist/utils/schema-sql/SQLite.js +129 -0
- package/dist/utils/schema-sql/Snowflake.js +148 -0
- package/dist/utils/schema-sql/index.d.ts +6 -3
- package/dist/utils/schema-sql/index.js +238 -0
- package/dist/utils/schema-sql/options.js +97 -0
- package/dist/utils/schema-sql/utils.d.ts +1 -43
- package/dist/utils/schema-sql/utils.js +251 -0
- package/dist/utils/schema-sql-parser/index.js +312 -0
- package/dist/utils/schema-sql-parser/utils.js +7 -0
- package/dist/utils/sharedColor.js +19 -0
- package/dist/utils/stageCursor.js +20 -0
- package/dist/utils/table-clipboard/copy.js +208 -0
- package/dist/utils/table-clipboard/index.js +28 -0
- package/dist/utils/table-clipboard/paste.js +154 -0
- package/dist/utils/table-clipboard/payload.js +73 -0
- package/dist/utils/table-clipboard/placement.js +54 -0
- package/dist/utils/tableColor.js +139 -0
- package/dist/utils/tableGroup.js +146 -0
- package/dist/utils/tableKeys.js +82 -0
- package/dist/utils/tableName.d.ts +47 -0
- package/dist/utils/tableName.js +72 -0
- package/dist/utils/takeover.js +10 -0
- package/dist/utils/text.js +47 -0
- package/dist/utils/validation.js +47 -0
- package/dist/utils/virtualRange.js +21 -0
- package/dist/uuid/dist/uuid25.js +11 -0
- package/dist/uuid/dist/uuidv7.js +25 -0
- package/dist/workers/elkLayout.shared-worker.js +327 -1
- package/dist/workers/elkLayout.spawn.d.ts +3 -0
- package/dist/workers/elkLayout.spawn.inline.d.ts +3 -0
- package/dist/workers/elkLayout.spawn.js +9 -0
- package/dist/workers/exportPng.shared-worker.js +32969 -55
- package/dist/workers/exportPng.spawn.d.ts +7 -0
- package/dist/workers/exportPng.spawn.inline.d.ts +7 -0
- package/dist/workers/exportPng.spawn.js +9 -0
- package/dist/workers/shiki.shared-worker.js +119 -1
- package/dist/workers/shiki.spawn.d.ts +3 -0
- package/dist/workers/shiki.spawn.inline.d.ts +3 -0
- package/dist/workers/shiki.spawn.js +9 -0
- package/package.json +35 -3
- package/dist/components/customElementRegistry.d.ts +0 -1
- package/dist/components/erd/diff-viewer/diffContext.d.ts +0 -9
- package/dist/components/erd/diff-viewer/erd-viewer/ErdViewer.d.ts +0 -11
- package/dist/loadValue-B5ojYrZ-.js +0 -14682
- package/dist/shared-store-S7YWEz3E.js +0 -1656
- package/dist/workers/spawn.d.ts +0 -9
- package/dist/workers/spawn.inline.d.ts +0 -9
- /package/dist/components/{explorer → erd}/fieldIcon.d.ts +0 -0
- /package/dist/components/erd/{floating-toolbar → view-controls}/ToolbarCompass.template.d.ts +0 -0
- /package/dist/components/erd/{floating-toolbar → view-controls}/nameViewDropdown.d.ts +0 -0
- /package/dist/components/erd/{floating-toolbar → view-controls}/nameViewDropdown.styles.d.ts +0 -0
|
@@ -1,1656 +0,0 @@
|
|
|
1
|
-
import { $a as e, Aa as t, Ac as n, Ba as r, C as i, Co as a, D as o, Ds as s, E as c, En as l, Eo as u, Es as d, Fa as f, Fn as p, Fo as m, Ga as h, Ia as g, Ja as _, Ka as v, La as y, Ma as b, Mc as x, Mr as S, Na as C, Nc as w, Nn as ee, Nr as te, Os as T, Pa as E, Pc as ne, Pn as re, Pr as ie, Qa as D, Ra as O, So as ae, T as oe, Tc as k, Tn as se, Ts as ce, Ua as A, Va as le, Wa as j, Xa as M, Ya as N, Za as P, _ as ue, _c as F, a as de, ao as I, b as fe, c as pe, cc as me, co as he, cs as L, eo as ge, g as _e, h as ve, i as ye, ja as R, kr as be, l as xe, m as Se, n as Ce, no as we, o as Te, pc as z, qa as Ee, r as De, rc as Oe, ro as B, s as ke, sc as V, so as Ae, tc as je, to as H, ur as Me, us as U, w as Ne, wi as Pe, wn as Fe, x as Ie, xo as W, ys as G, za as K } from "./loadValue-B5ojYrZ-.js";
|
|
2
|
-
import { Observable as q, Subject as J, debounceTime as Le, filter as Re, map as ze, merge as Be, race as Ve, startWith as He, switchMap as Ue, take as We, timer as Ge } from "rxjs";
|
|
3
|
-
import { isEmpty as Ke } from "es-toolkit/compat";
|
|
4
|
-
import { isFunction as qe, isNil as Je } from "es-toolkit";
|
|
5
|
-
//#region src/engine/history.ts
|
|
6
|
-
function Ye({ notify: e, dispatch: t, getNextVersion: n, getState: r }, i) {
|
|
7
|
-
let a = i?.commands ?? [], o = i?.cursor ?? -1, s = i?.limit ?? 0, c = !0, l = () => o !== -1, u = () => o < a.length - 1, d = (e) => s = e, f = () => ({
|
|
8
|
-
hasRedo: u(),
|
|
9
|
-
hasUndo: l()
|
|
10
|
-
}), p = (e, i) => {
|
|
11
|
-
c = !1, e[i](t, n, r), c = !0;
|
|
12
|
-
};
|
|
13
|
-
return Object.freeze({
|
|
14
|
-
get cursor() {
|
|
15
|
-
return o;
|
|
16
|
-
},
|
|
17
|
-
get size() {
|
|
18
|
-
return a.length;
|
|
19
|
-
},
|
|
20
|
-
hasUndo: l,
|
|
21
|
-
hasRedo: u,
|
|
22
|
-
push: (t) => {
|
|
23
|
-
c && (a.splice(o + 1, a.length - o), a.push(t), s !== 0 && a.length > s && (a = a.slice(a.length - s, a.length)), o = a.length - 1, e(f()));
|
|
24
|
-
},
|
|
25
|
-
undo: () => {
|
|
26
|
-
if (!l()) return;
|
|
27
|
-
let t = a[o];
|
|
28
|
-
p(t, "undo"), o--, e(f());
|
|
29
|
-
},
|
|
30
|
-
redo: () => {
|
|
31
|
-
if (!u()) return;
|
|
32
|
-
let t = a[o + 1];
|
|
33
|
-
p(t, "redo"), o++, e(f());
|
|
34
|
-
},
|
|
35
|
-
clear: () => {
|
|
36
|
-
let t = a.length;
|
|
37
|
-
a = [], o = -1, t > 0 && e(f());
|
|
38
|
-
},
|
|
39
|
-
setLimit: d,
|
|
40
|
-
clone: (e) => Ye(e, {
|
|
41
|
-
commands: [...a],
|
|
42
|
-
cursor: o,
|
|
43
|
-
limit: s
|
|
44
|
-
})
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/engine/rx-operators/flushOnNotifier.ts
|
|
49
|
-
var Xe = (e) => (t) => t.pipe(Ue((t) => e.pipe(We(1), ze(() => t)))), Ze = (e, t = 200) => (n) => n.pipe(Ue((n) => Ve(Ge(t), e.pipe(We(1))).pipe(ze(() => n)))), Qe = (e) => {
|
|
50
|
-
let t = (e) => (t) => {
|
|
51
|
-
let n = Reflect.get(_e, t.type);
|
|
52
|
-
return !n || !w(e, n);
|
|
53
|
-
};
|
|
54
|
-
return (n) => new q((r) => n.subscribe({
|
|
55
|
-
next: (n) => {
|
|
56
|
-
r.next(n.filter(t(e())));
|
|
57
|
-
},
|
|
58
|
-
error: (e) => r.error(e),
|
|
59
|
-
complete: () => r.complete()
|
|
60
|
-
})).pipe(xe);
|
|
61
|
-
}, $e = (e, t = []) => {
|
|
62
|
-
let n = je(ue), r = (e) => !Je(e.tags) && t.some((t) => L(e.tags, t)) || !n(e.type);
|
|
63
|
-
return (t) => new q((n) => t.subscribe({
|
|
64
|
-
next: (t) => {
|
|
65
|
-
n.next(e() ? t.filter(r) : t);
|
|
66
|
-
},
|
|
67
|
-
error: (e) => n.error(e),
|
|
68
|
-
complete: () => n.complete()
|
|
69
|
-
})).pipe(xe);
|
|
70
|
-
}, et = {
|
|
71
|
-
[Pe.scrollTo]: G.viewScrollTo,
|
|
72
|
-
[Pe.streamScrollTo]: G.viewStreamScrollTo,
|
|
73
|
-
[Pe.changeZoomLevel]: G.viewChangeZoomLevel,
|
|
74
|
-
[Pe.streamZoomLevel]: G.viewStreamZoomLevel
|
|
75
|
-
}, tt = ({ tags: e }) => !Je(e) && (L(e, W.shared) || L(e, W.following)), nt = (e) => {
|
|
76
|
-
let t = et[e.type];
|
|
77
|
-
return t && !tt(e) ? {
|
|
78
|
-
...e,
|
|
79
|
-
type: t
|
|
80
|
-
} : e;
|
|
81
|
-
}, rt = (e) => (t) => new q((n) => t.subscribe({
|
|
82
|
-
next: (t) => {
|
|
83
|
-
n.next(e() ? t.map(nt) : t);
|
|
84
|
-
},
|
|
85
|
-
error: (e) => n.error(e),
|
|
86
|
-
complete: () => n.complete()
|
|
87
|
-
})), it = (e, t = []) => {
|
|
88
|
-
let n = je(o), r = (e) => !Je(e.tags) && t.some((t) => L(e.tags, t)) || !n(e.type);
|
|
89
|
-
return (t) => new q((n) => t.subscribe({
|
|
90
|
-
next: (t) => {
|
|
91
|
-
n.next(e() ? t.filter(r) : t);
|
|
92
|
-
},
|
|
93
|
-
error: (e) => n.error(e),
|
|
94
|
-
complete: () => n.complete()
|
|
95
|
-
})).pipe(xe);
|
|
96
|
-
}, at = 2048, ot = je([G.loadJson, G.clear]), st = ({ type: e, payload: t }) => ot(e) && !te(t);
|
|
97
|
-
function ct(e, { getReadonly: t = () => !1, getHistory: n, manualStreamFlush: r = !1, observable: a = !0 } = {}) {
|
|
98
|
-
let o = /* @__PURE__ */ new Set(), s = De(e, a), l = Ce(s), d = {
|
|
99
|
-
notify: (e) => s.dispatch(Me(e)),
|
|
100
|
-
dispatch: s.dispatchSync,
|
|
101
|
-
getNextVersion: () => e.clock.getNextVersion(),
|
|
102
|
-
getState: () => s.state
|
|
103
|
-
}, f = n?.(d) ?? Ye(d);
|
|
104
|
-
f.setLimit(at);
|
|
105
|
-
let h = Object.fromEntries(me.map((e) => {
|
|
106
|
-
let t = Ye({
|
|
107
|
-
...d,
|
|
108
|
-
notify: (t) => s.dispatch(Me({
|
|
109
|
-
...t,
|
|
110
|
-
sheet: e
|
|
111
|
-
}))
|
|
112
|
-
});
|
|
113
|
-
return t.setLimit(at), [e, t];
|
|
114
|
-
})), g = () => me.forEach((e) => h[e].clear()), _ = (e) => {
|
|
115
|
-
let t = e.find(ee);
|
|
116
|
-
return t ? h[t.payload?.kind] : null;
|
|
117
|
-
}, v = (e) => {
|
|
118
|
-
let t = u(e, W.dictionarySheet) ? _(e) : null;
|
|
119
|
-
t ? p(s, t)(e) : S.next(e);
|
|
120
|
-
}, y = () => m(s.state), b = new J(), x = b.pipe(rt(y)), S = new J(), C = new J(), w = new J(), te = C.pipe(He(void 0), Ue(() => S.pipe(Te(i, [
|
|
121
|
-
[
|
|
122
|
-
"@@move",
|
|
123
|
-
oe,
|
|
124
|
-
W.drag
|
|
125
|
-
],
|
|
126
|
-
["@@scroll", c],
|
|
127
|
-
["@@color", Ne]
|
|
128
|
-
], r ? Xe(w) : void 0)))), T = new q((e) => s.subscribe((t) => e.next(t))).pipe(pe(Se), Qe(() => s.state.settings.lockSettings), $e(t, [W.shared]), Le(200)), E = (...t) => {
|
|
129
|
-
let n = e.clock.getNextVersion();
|
|
130
|
-
return ne(s.state, s.context, t).map((e) => (Je(e.version) && (e.version = n), e));
|
|
131
|
-
}, ie = (...e) => {
|
|
132
|
-
let t = E(e);
|
|
133
|
-
b.next(t);
|
|
134
|
-
}, D = (...e) => {
|
|
135
|
-
queueMicrotask(() => ie(e));
|
|
136
|
-
}, O = () => {
|
|
137
|
-
Array.from(o).forEach((e) => qe(e) ? e() : e.unsubscribe()), o.clear(), s.destroy(), l.destroy(), f.clear(), g(), b.complete(), w.complete();
|
|
138
|
-
}, ae = () => {
|
|
139
|
-
C.next(), f.clear(), g();
|
|
140
|
-
}, k = () => {
|
|
141
|
-
t() || y() || f.undo();
|
|
142
|
-
}, se = () => {
|
|
143
|
-
t() || y() || f.redo();
|
|
144
|
-
}, ce = (e) => {
|
|
145
|
-
t() || y() || h[e]?.undo();
|
|
146
|
-
}, A = (e) => {
|
|
147
|
-
t() || y() || h[e]?.redo();
|
|
148
|
-
}, le = () => {
|
|
149
|
-
r && w.next();
|
|
150
|
-
};
|
|
151
|
-
return o.add(te.subscribe(re(s, f))).add(x.pipe(pe(ve), de([W.changeOnly, W.shared]), $e(t), it(y)).subscribe(v)).add(x.pipe($e(t, [W.shared]), it(y, [W.shared])).subscribe(s.dispatchSync)).add(s.subscribe((t) => {
|
|
152
|
-
t.forEach((t) => e.clock.merge(t.version));
|
|
153
|
-
})).add(s.subscribe((e) => {
|
|
154
|
-
e.some(st) && g();
|
|
155
|
-
})), Object.freeze({
|
|
156
|
-
...s,
|
|
157
|
-
dispatch: D,
|
|
158
|
-
dispatchSync: ie,
|
|
159
|
-
destroy: O,
|
|
160
|
-
undo: k,
|
|
161
|
-
redo: se,
|
|
162
|
-
history: f,
|
|
163
|
-
sheetHistories: h,
|
|
164
|
-
undoSheet: ce,
|
|
165
|
-
redoSheet: A,
|
|
166
|
-
resetHistory: ae,
|
|
167
|
-
change$: T,
|
|
168
|
-
flushStreamBuffers: le,
|
|
169
|
-
getReadonly: t
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
//#endregion
|
|
173
|
-
//#region src/engine/modules/dictionary/checks.ts
|
|
174
|
-
var Y = {
|
|
175
|
-
duplicateName: "duplicateName",
|
|
176
|
-
unknownDomain: "unknownDomain",
|
|
177
|
-
unregisteredWord: "unregisteredWord",
|
|
178
|
-
forbiddenWord: "forbiddenWord",
|
|
179
|
-
synonymWord: "synonymWord",
|
|
180
|
-
physicalNameMismatch: "physicalNameMismatch",
|
|
181
|
-
domainTypeMismatch: "domainTypeMismatch"
|
|
182
|
-
};
|
|
183
|
-
Object.values(Y);
|
|
184
|
-
var X = {
|
|
185
|
-
error: "error",
|
|
186
|
-
warning: "warning"
|
|
187
|
-
}, lt = {
|
|
188
|
-
duplicateName: X.error,
|
|
189
|
-
unknownDomain: X.error,
|
|
190
|
-
unregisteredWord: X.warning,
|
|
191
|
-
forbiddenWord: X.error,
|
|
192
|
-
synonymWord: X.warning,
|
|
193
|
-
physicalNameMismatch: X.warning,
|
|
194
|
-
domainTypeMismatch: X.warning
|
|
195
|
-
}, ut = {
|
|
196
|
-
[Fe.synonym]: Y.synonymWord,
|
|
197
|
-
[Fe.forbidden]: Y.forbiddenWord,
|
|
198
|
-
[Fe.unregistered]: Y.unregisteredWord
|
|
199
|
-
}, dt = (e) => [...new Set(e.map(({ name: e }) => T(e)))], ft = Object.freeze([]);
|
|
200
|
-
function pt(e, t) {
|
|
201
|
-
if (e.byName.size === 0) return ft;
|
|
202
|
-
let n = [], r = /* @__PURE__ */ new Set();
|
|
203
|
-
for (let i of l(e, t)) {
|
|
204
|
-
if (i.kind === Fe.word) continue;
|
|
205
|
-
let e = ut[i.kind], t = `${e}:${i.text}`;
|
|
206
|
-
r.has(t) || (r.add(t), n.push({
|
|
207
|
-
code: e,
|
|
208
|
-
text: i.text,
|
|
209
|
-
suggestions: dt(i.words)
|
|
210
|
-
}));
|
|
211
|
-
}
|
|
212
|
-
return n.length ? n : ft;
|
|
213
|
-
}
|
|
214
|
-
function mt(e, t, n) {
|
|
215
|
-
for (let { code: r, text: i, suggestions: a } of e) n({
|
|
216
|
-
code: r,
|
|
217
|
-
field: t,
|
|
218
|
-
text: i,
|
|
219
|
-
suggestions: a
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
var ht = (e, t, n, r) => mt(pt(s(e), n), t, r);
|
|
223
|
-
function gt(e, t, n, r, i) {
|
|
224
|
-
let a = T(n), o = a ? e.byName.get(a)?.[0] : void 0;
|
|
225
|
-
if (!o) return;
|
|
226
|
-
let s = o.physicalName.trim() || (t.byName.size === 0 ? "" : se(l(t, a)) ?? "");
|
|
227
|
-
s && r.trim() !== s && i({
|
|
228
|
-
code: Y.physicalNameMismatch,
|
|
229
|
-
field: "name",
|
|
230
|
-
text: r,
|
|
231
|
-
suggestions: [s]
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
function _t(e, t, n = e.doc.domainIds) {
|
|
235
|
-
return !t || n.length === 0 || Oe(n, t) ? null : e.collections.domainEntities[t]?.name || t;
|
|
236
|
-
}
|
|
237
|
-
function Z(e, t, n, r = e.doc.domainIds) {
|
|
238
|
-
let i = _t(e, t, r);
|
|
239
|
-
i !== null && n({
|
|
240
|
-
code: Y.unknownDomain,
|
|
241
|
-
field: "domainId",
|
|
242
|
-
text: i,
|
|
243
|
-
suggestions: []
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
function vt(e, t, n = e.doc.domainIds) {
|
|
247
|
-
return !t || !Oe(n, t) ? null : e.collections.domainEntities[t]?.dataType ?? null;
|
|
248
|
-
}
|
|
249
|
-
function yt(e, { domainId: t, dataType: n }, r, i = e.doc.domainIds) {
|
|
250
|
-
let a = vt(e, t, i);
|
|
251
|
-
a !== null && a !== n && r({
|
|
252
|
-
code: Y.domainTypeMismatch,
|
|
253
|
-
field: "domainId",
|
|
254
|
-
text: n,
|
|
255
|
-
suggestions: [a]
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
var bt = {
|
|
259
|
-
[V.word]: s,
|
|
260
|
-
[V.term]: d,
|
|
261
|
-
[V.domain]: ce
|
|
262
|
-
};
|
|
263
|
-
function xt(e, t, n) {
|
|
264
|
-
let r = t ? e.byName.get(t) : void 0;
|
|
265
|
-
return !!r && r.length > 1 && r.some((e) => e.id === n);
|
|
266
|
-
}
|
|
267
|
-
function St(e, t, n) {
|
|
268
|
-
let r = T(t.name);
|
|
269
|
-
xt(e, r, t.id) && n({
|
|
270
|
-
code: Y.duplicateName,
|
|
271
|
-
field: "name",
|
|
272
|
-
text: r,
|
|
273
|
-
suggestions: []
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
function Ct(e, t, n) {
|
|
277
|
-
let r = [];
|
|
278
|
-
return n((e) => !t || e === t, (t) => r.push({
|
|
279
|
-
...t,
|
|
280
|
-
target: e
|
|
281
|
-
})), r;
|
|
282
|
-
}
|
|
283
|
-
var wt = (e, t, n) => Ct({
|
|
284
|
-
kind: "table",
|
|
285
|
-
id: t.id,
|
|
286
|
-
tableId: t.id
|
|
287
|
-
}, n, (n, r) => {
|
|
288
|
-
n("logicalName") && ht(e, "logicalName", t.logicalName, r), n("name") && gt(d(e), s(e), t.logicalName, t.name, r);
|
|
289
|
-
}), Tt = (e, t, n) => Ct({
|
|
290
|
-
kind: "column",
|
|
291
|
-
id: t.id,
|
|
292
|
-
tableId: t.tableId
|
|
293
|
-
}, n, (n, r) => {
|
|
294
|
-
n("logicalName") && ht(e, "logicalName", t.logicalName, r), n("name") && gt(d(e), s(e), t.logicalName, t.name, r), n("domainId") && (Z(e, t.domainId, r), yt(e, t, r));
|
|
295
|
-
});
|
|
296
|
-
function Et(e, t, n, r) {
|
|
297
|
-
return Ct({
|
|
298
|
-
kind: t,
|
|
299
|
-
id: n.id,
|
|
300
|
-
tableId: ""
|
|
301
|
-
}, r, (r, i) => {
|
|
302
|
-
if (r("name") && St(bt[t](e), n, i), t !== V.term) return;
|
|
303
|
-
let a = n;
|
|
304
|
-
r("name") && ht(e, "name", a.name, i), r("domainId") && Z(e, a.domainId, i);
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
function Dt(e) {
|
|
308
|
-
let t = null;
|
|
309
|
-
for (let { code: n } of e) if (t = lt[n], t === X.error) break;
|
|
310
|
-
return t;
|
|
311
|
-
}
|
|
312
|
-
var Ot = /* @__PURE__ */ new WeakMap();
|
|
313
|
-
function kt(e) {
|
|
314
|
-
let t = Ot.get(e);
|
|
315
|
-
return t || (t = {
|
|
316
|
-
held: /* @__PURE__ */ new Map(),
|
|
317
|
-
walk: 0,
|
|
318
|
-
met: 0
|
|
319
|
-
}, Ot.set(e, t)), t.walk++, t.met = 0, t;
|
|
320
|
-
}
|
|
321
|
-
function At(e, t) {
|
|
322
|
-
if (e.walk === t && e.held.size !== e.met) for (let [n, r] of e.held) r.walk !== t && e.held.delete(n);
|
|
323
|
-
}
|
|
324
|
-
var jt = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]);
|
|
325
|
-
function Mt(e, t, n, r) {
|
|
326
|
-
let i = e?.reading;
|
|
327
|
-
if (i && i.words === n && i.text === r) return i;
|
|
328
|
-
let a = t.get(r);
|
|
329
|
-
return a || (a = {
|
|
330
|
-
words: n,
|
|
331
|
-
text: r,
|
|
332
|
-
name: T(r),
|
|
333
|
-
findings: pt(n, r)
|
|
334
|
-
}, t.set(r, a)), a;
|
|
335
|
-
}
|
|
336
|
-
function Nt(e, t, n, r, i, a, o) {
|
|
337
|
-
let s = e.held.get(n.id);
|
|
338
|
-
s?.walk !== e.walk && e.met++;
|
|
339
|
-
let c = Mt(s, t, r, i), l = a(c);
|
|
340
|
-
if (!s || s.reading !== c || !jt(s.inputs, l)) {
|
|
341
|
-
let t = [];
|
|
342
|
-
o((e) => t.push({
|
|
343
|
-
...e,
|
|
344
|
-
target: n
|
|
345
|
-
}), c), s = {
|
|
346
|
-
walk: e.walk,
|
|
347
|
-
reading: c,
|
|
348
|
-
inputs: l,
|
|
349
|
-
checks: t.length ? t : ft
|
|
350
|
-
}, e.held.set(n.id, s);
|
|
351
|
-
}
|
|
352
|
-
return s.walk = e.walk, s.checks;
|
|
353
|
-
}
|
|
354
|
-
var Pt = (e, t) => e.byName.get(t)?.[0]?.physicalName ?? null, Ft = /* @__PURE__ */ new WeakMap();
|
|
355
|
-
function It(e, t) {
|
|
356
|
-
let n = Ft.get(t);
|
|
357
|
-
return n || (n = t.rows.flatMap((n) => Ct({
|
|
358
|
-
kind: e,
|
|
359
|
-
id: n.id,
|
|
360
|
-
tableId: ""
|
|
361
|
-
}, void 0, (e, r) => St(t, n, r))), Ft.set(t, n)), n;
|
|
362
|
-
}
|
|
363
|
-
var Lt = /* @__PURE__ */ new WeakMap();
|
|
364
|
-
function* Rt(e, t, n, r, i) {
|
|
365
|
-
let a = Lt.get(r);
|
|
366
|
-
if (a && a.words === n && a.domains === i) {
|
|
367
|
-
yield a.checks;
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
let o = kt(e.collections.termEntities), { walk: s } = o, { domainIds: c } = e.doc, l = [];
|
|
371
|
-
for (let i of r.rows) {
|
|
372
|
-
let { id: a, name: s, domainId: u } = i, d = Nt(o, t, {
|
|
373
|
-
kind: V.term,
|
|
374
|
-
id: a,
|
|
375
|
-
tableId: ""
|
|
376
|
-
}, n, s, (t) => [xt(r, t.name, a), _t(e, u, c)], (t, n) => {
|
|
377
|
-
St(r, i, t), mt(n.findings, "name", t), Z(e, u, t, c);
|
|
378
|
-
});
|
|
379
|
-
for (let e of d) l.push(e);
|
|
380
|
-
yield d;
|
|
381
|
-
}
|
|
382
|
-
At(o, s), Lt.set(r, {
|
|
383
|
-
words: n,
|
|
384
|
-
domains: i,
|
|
385
|
-
checks: l
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
function* zt(e) {
|
|
389
|
-
let { doc: t, collections: r } = e, i = s(e), a = d(e), o = ce(e), c = /* @__PURE__ */ new Map();
|
|
390
|
-
yield It(V.word, i), yield* Rt(e, c, i, a, o), yield It(V.domain, o);
|
|
391
|
-
let l = kt(r.tableEntities), u = l.walk, f = kt(r.tableColumnEntities), p = f.walk, { domainIds: m } = t, h = n(r).collection("tableEntities").selectByIds(t.tableIds), g = n(r).collection("tableColumnEntities");
|
|
392
|
-
for (let t of h) {
|
|
393
|
-
let { id: n, logicalName: r, name: o } = t;
|
|
394
|
-
yield Nt(l, c, {
|
|
395
|
-
kind: "table",
|
|
396
|
-
id: n,
|
|
397
|
-
tableId: n
|
|
398
|
-
}, i, r, (e) => [o, Pt(a, e.name)], (e, t) => {
|
|
399
|
-
mt(t.findings, "logicalName", e), gt(a, i, r, o, e);
|
|
400
|
-
});
|
|
401
|
-
for (let n of g.selectByIds(t.columnIds)) {
|
|
402
|
-
let { id: t, tableId: r, logicalName: o, name: s, domainId: l, dataType: u } = n;
|
|
403
|
-
yield Nt(f, c, {
|
|
404
|
-
kind: "column",
|
|
405
|
-
id: t,
|
|
406
|
-
tableId: r
|
|
407
|
-
}, i, o, (t) => [
|
|
408
|
-
r,
|
|
409
|
-
s,
|
|
410
|
-
Pt(a, t.name),
|
|
411
|
-
_t(e, l, m),
|
|
412
|
-
u,
|
|
413
|
-
vt(e, l, m)
|
|
414
|
-
], (t, r) => {
|
|
415
|
-
mt(r.findings, "logicalName", t), gt(a, i, o, s, t), Z(e, l, t, m), yt(e, n, t, m);
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
At(l, u), At(f, p);
|
|
420
|
-
}
|
|
421
|
-
function Bt(e) {
|
|
422
|
-
let t = [];
|
|
423
|
-
for (let n of zt(e)) for (let e of n) t.push(e);
|
|
424
|
-
return t;
|
|
425
|
-
}
|
|
426
|
-
//#endregion
|
|
427
|
-
//#region src/utils/focus.ts
|
|
428
|
-
function Vt(e, t, n, r = null) {
|
|
429
|
-
if (!e || n !== e.tableId) return !1;
|
|
430
|
-
switch (t) {
|
|
431
|
-
case U.tableName:
|
|
432
|
-
case U.tableLogicalName:
|
|
433
|
-
case U.tableComment: return t === e.focusType;
|
|
434
|
-
}
|
|
435
|
-
return r === e.columnId && t === e.focusType;
|
|
436
|
-
}
|
|
437
|
-
var Ht = (e, t, n) => e?.tableId === t && e.selectColumnIds.includes(n), Ut = (e, t, n) => e?.tableId === t && e.columnId === n;
|
|
438
|
-
function Wt(e, t, n, r = null) {
|
|
439
|
-
if (e?.tableId !== n) return !1;
|
|
440
|
-
switch (t) {
|
|
441
|
-
case U.tableName:
|
|
442
|
-
case U.tableLogicalName:
|
|
443
|
-
case U.tableComment: return t === e.focusType && e.edit;
|
|
444
|
-
}
|
|
445
|
-
return r === e.columnId && t === e.focusType && e.edit;
|
|
446
|
-
}
|
|
447
|
-
function Gt(e) {
|
|
448
|
-
let t = e.value.length;
|
|
449
|
-
e.selectionStart = t, e.selectionEnd = t, e.focus();
|
|
450
|
-
}
|
|
451
|
-
var Kt = (e) => e ? {
|
|
452
|
-
tableId: e.tableId,
|
|
453
|
-
columnId: e.columnId,
|
|
454
|
-
focusType: e.focusType
|
|
455
|
-
} : null, qt = (e) => e ? JSON.stringify([
|
|
456
|
-
e.tableId,
|
|
457
|
-
e.columnId,
|
|
458
|
-
e.focusType
|
|
459
|
-
]) : "", Q = "`";
|
|
460
|
-
function Jt(e) {
|
|
461
|
-
return `'${e.replace(/[\\']/g, "\\$&")}'`;
|
|
462
|
-
}
|
|
463
|
-
var Yt = "NOT ENFORCED RELY", Xt = h(F.Databricks), Zt = /* @__PURE__ */ new Set(["BIGINT", "LONG"]);
|
|
464
|
-
function Qt(e) {
|
|
465
|
-
return L(e.options, z.autoIncrement) && Zt.has(e.dataType.trim().toUpperCase());
|
|
466
|
-
}
|
|
467
|
-
function $t(e, t, { statements: n, written: r, logicalNameAsComment: i } = {}) {
|
|
468
|
-
let a = [], o = [], s = [""], { tables: c, relationships: l, indexes: u } = D(e, t);
|
|
469
|
-
return c.forEach((t) => {
|
|
470
|
-
r?.tables.push(t), en(e, {
|
|
471
|
-
table: t,
|
|
472
|
-
buffer: s,
|
|
473
|
-
statements: n,
|
|
474
|
-
logicalNameAsComment: i
|
|
475
|
-
}), s.push(""), tn(e, {
|
|
476
|
-
table: t,
|
|
477
|
-
buffer: s
|
|
478
|
-
});
|
|
479
|
-
}), l.forEach((t) => {
|
|
480
|
-
rn(e, {
|
|
481
|
-
relationship: t,
|
|
482
|
-
buffer: s,
|
|
483
|
-
fkNames: a,
|
|
484
|
-
statements: n
|
|
485
|
-
}) && s.push("");
|
|
486
|
-
}), u.forEach((t) => {
|
|
487
|
-
an(e, {
|
|
488
|
-
index: t,
|
|
489
|
-
buffer: s,
|
|
490
|
-
indexNames: o
|
|
491
|
-
}), s.push("");
|
|
492
|
-
}), s.join("\n");
|
|
493
|
-
}
|
|
494
|
-
function en(e, { buffer: t, table: i, statements: a, logicalNameAsComment: o }) {
|
|
495
|
-
let { collections: s } = e, c = n(s).collection("tableColumnEntities").selectByIds(i.columnIds);
|
|
496
|
-
t.push(`CREATE TABLE${r(a)} ${Q}${i.name}${Q}`), t.push("(");
|
|
497
|
-
let l = A(c), u = y(c);
|
|
498
|
-
if (c.forEach((n, r) => {
|
|
499
|
-
nn(e, {
|
|
500
|
-
column: n,
|
|
501
|
-
isComma: l || c.length !== r + 1,
|
|
502
|
-
spaceSize: u,
|
|
503
|
-
buffer: t,
|
|
504
|
-
logicalNameAsComment: o
|
|
505
|
-
});
|
|
506
|
-
}), l) {
|
|
507
|
-
let e = j(c);
|
|
508
|
-
t.push(` CONSTRAINT ${Q}PK_${i.name}${Q} PRIMARY KEY (${f(e, Q)}) ${Yt}`);
|
|
509
|
-
}
|
|
510
|
-
t.push(")");
|
|
511
|
-
let d = b(i, o);
|
|
512
|
-
d === "" ? t.push("USING DELTA;") : (t.push("USING DELTA"), t.push(`COMMENT ${Jt(d)};`));
|
|
513
|
-
let p = c.filter((e) => L(e.options, z.autoIncrement) && !Qt(e));
|
|
514
|
-
p.length !== 0 && (t.push(""), p.forEach((e) => {
|
|
515
|
-
t.push(`-- Databricks takes IDENTITY only on BIGINT, so ${Q}${i.name}${Q}.${Q}${e.name}${Q} is written without it.`);
|
|
516
|
-
}));
|
|
517
|
-
}
|
|
518
|
-
function tn({ collections: e }, { buffer: t, table: r }) {
|
|
519
|
-
let i = n(e).collection("tableColumnEntities").selectByIds(r.columnIds);
|
|
520
|
-
H(i).forEach((e) => {
|
|
521
|
-
t.push(`-- Databricks does not support UNIQUE constraints: ${Q}${r.name}${Q}.${Q}${e.name}${Q}`), t.push("");
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
function nn(e, { buffer: t, column: n, isComma: r, spaceSize: i, logicalNameAsComment: a }) {
|
|
525
|
-
let o = [];
|
|
526
|
-
o.push(` ${Q}${n.name}${Q}` + O(i.name - n.name.length)), o.push(`${n.dataType}` + O(i.dataType - n.dataType.length));
|
|
527
|
-
let s = L(n.options, z.notNull) || L(n.options, z.primaryKey);
|
|
528
|
-
o.push(s ? "NOT NULL" : " "), Qt(n) ? o.push("GENERATED ALWAYS AS IDENTITY") : !L(n.options, z.autoIncrement) && n.default.trim() !== "" && o.push(`DEFAULT ${n.default}`);
|
|
529
|
-
let c = b(n, a);
|
|
530
|
-
c !== "" && o.push(`COMMENT ${Jt(c)}`), t.push(o.join(" ").trimEnd() + `${r ? "," : ""}`);
|
|
531
|
-
}
|
|
532
|
-
function rn(e, { buffer: n, relationship: r, fkNames: i, statements: a }) {
|
|
533
|
-
let o = M(e, r);
|
|
534
|
-
if (!o) return !1;
|
|
535
|
-
let { startTable: s, endTable: c } = o, l = `FK_${s.name}_TO_${c.name}`;
|
|
536
|
-
l = t(i, "", l), i.push({
|
|
537
|
-
id: x(),
|
|
538
|
-
name: l
|
|
539
|
-
});
|
|
540
|
-
let u = `ALTER TABLE ${Q}${c.name}${Q}`;
|
|
541
|
-
return a === I.ifNotExists && n.push(`${u} DROP CONSTRAINT IF EXISTS ${Q}${l}${Q};`), n.push(u), n.push(` ADD CONSTRAINT ${Q}${l}${Q}`), n.push(` FOREIGN KEY (${f(o.end, Q)})`), n.push([
|
|
542
|
-
` REFERENCES ${Q}${s.name}${Q} (${f(o.start, Q)})`,
|
|
543
|
-
...g(r, Xt),
|
|
544
|
-
`${Yt};`
|
|
545
|
-
].join(" ")), !0;
|
|
546
|
-
}
|
|
547
|
-
function an({ collections: e }, { buffer: r, index: i, indexNames: a }) {
|
|
548
|
-
let o = n(e).collection("tableEntities").selectById(i.tableId);
|
|
549
|
-
if (!o) return;
|
|
550
|
-
let s = v(e, o, i).map(({ indexColumn: e, column: t }) => ({ name: `${Q}${t.name}${Q} ${P(e.orderType)}` }));
|
|
551
|
-
if (s.length === 0) return;
|
|
552
|
-
let c = i.name;
|
|
553
|
-
i.name.trim() === "" && (c = `IDX_${o.name}`, c = t(a, "", c), a.push({
|
|
554
|
-
id: x(),
|
|
555
|
-
name: c
|
|
556
|
-
})), r.push(`-- Databricks has no secondary indexes. ${Q}${c}${Q} on ${Q}${o.name}${Q} (${f(s)})`), r.push(`-- ALTER TABLE ${Q}${o.name}${Q} CLUSTER BY (${f(v(e, o, i).map(({ column: e }) => e), Q)});`);
|
|
557
|
-
}
|
|
558
|
-
function on(e, t, n) {
|
|
559
|
-
let r = `${Q}${n}${Q}`, i = `USE SCHEMA ${r};`;
|
|
560
|
-
return t === B.createAndUse ? `CREATE SCHEMA IF NOT EXISTS ${r};\n${i}` : i;
|
|
561
|
-
}
|
|
562
|
-
function sn(e, { tables: t }) {
|
|
563
|
-
return t.map(({ name: e }) => `DROP TABLE IF EXISTS ${Q}${e}${Q};`).join("\n");
|
|
564
|
-
}
|
|
565
|
-
//#endregion
|
|
566
|
-
//#region src/utils/schema-sql/MySQL.ts
|
|
567
|
-
var cn = h(F.MySQL), ln = "SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;", un = "SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;";
|
|
568
|
-
function dn(e, t, { statements: n, written: r, logicalNameAsComment: i } = {}) {
|
|
569
|
-
if (n === I.ifNotExists) return fn(e, t, r, i);
|
|
570
|
-
let a = [], o = [], s = [""], { tables: c, relationships: l, indexes: u } = D(e, t);
|
|
571
|
-
return c.forEach((t) => {
|
|
572
|
-
r?.tables.push(t), pn(e, {
|
|
573
|
-
table: t,
|
|
574
|
-
buffer: s,
|
|
575
|
-
logicalNameAsComment: i
|
|
576
|
-
}), s.push(""), gn(e, {
|
|
577
|
-
table: t,
|
|
578
|
-
buffer: s
|
|
579
|
-
});
|
|
580
|
-
}), l.forEach((t) => {
|
|
581
|
-
yn(e, {
|
|
582
|
-
relationship: t,
|
|
583
|
-
buffer: s,
|
|
584
|
-
fkNames: a
|
|
585
|
-
}) && s.push("");
|
|
586
|
-
}), u.forEach((t) => {
|
|
587
|
-
xn(e, {
|
|
588
|
-
index: t,
|
|
589
|
-
buffer: s,
|
|
590
|
-
indexNames: o
|
|
591
|
-
}), s.push("");
|
|
592
|
-
}), s.join("\n");
|
|
593
|
-
}
|
|
594
|
-
function fn(e, t, r, i) {
|
|
595
|
-
let { settings: { bracketType: a }, collections: o } = e, { tables: s, relationships: c, indexes: l } = D(e, t);
|
|
596
|
-
if (s.length === 0) return "";
|
|
597
|
-
let u = [], d = /* @__PURE__ */ new Map();
|
|
598
|
-
c.forEach((t) => {
|
|
599
|
-
let n = vn(e, t, u);
|
|
600
|
-
if (!n) return;
|
|
601
|
-
let [r, ...i] = n.lines, a = d.get(n.table.id) ?? [];
|
|
602
|
-
a.push([` ${r}`, ...i]), d.set(n.table.id, a);
|
|
603
|
-
});
|
|
604
|
-
let f = [], p = /* @__PURE__ */ new Map();
|
|
605
|
-
l.forEach((t) => {
|
|
606
|
-
let n = bn(e, t, f);
|
|
607
|
-
if (!n) return;
|
|
608
|
-
let r = p.get(n.table.id) ?? [];
|
|
609
|
-
r.push([` ${t.unique ? "UNIQUE " : ""}INDEX ${n.name} (${n.columns})`]), p.set(n.table.id, r);
|
|
610
|
-
});
|
|
611
|
-
let m = [
|
|
612
|
-
"",
|
|
613
|
-
ln,
|
|
614
|
-
""
|
|
615
|
-
];
|
|
616
|
-
return s.forEach((t) => {
|
|
617
|
-
r?.tables.push(t);
|
|
618
|
-
let s = n(o).collection("tableColumnEntities").selectByIds(t.columnIds);
|
|
619
|
-
mn(e, m, t, I.ifNotExists, [
|
|
620
|
-
...H(s).map((e) => [` ${hn(a, t, e)}`]),
|
|
621
|
-
...p.get(t.id) ?? [],
|
|
622
|
-
...d.get(t.id) ?? []
|
|
623
|
-
], i), m.push("");
|
|
624
|
-
}), m.push(un, ""), m.join("\n");
|
|
625
|
-
}
|
|
626
|
-
function pn(e, { buffer: t, table: n, statements: r, logicalNameAsComment: i }) {
|
|
627
|
-
mn(e, t, n, r, [], i);
|
|
628
|
-
}
|
|
629
|
-
function mn(t, i, a, o, s, c) {
|
|
630
|
-
let { settings: { bracketType: l }, collections: u } = t, d = K(l), p = n(u).collection("tableColumnEntities").selectByIds(a.columnIds);
|
|
631
|
-
i.push(`CREATE TABLE${r(o)} ${d}${a.name}${d}`), i.push("(");
|
|
632
|
-
let m = A(p), h = y(p), g = s.length !== 0;
|
|
633
|
-
if (p.forEach((e, n) => {
|
|
634
|
-
_n(t, {
|
|
635
|
-
column: e,
|
|
636
|
-
isComma: m || g || p.length !== n + 1,
|
|
637
|
-
spaceSize: h,
|
|
638
|
-
buffer: i,
|
|
639
|
-
logicalNameAsComment: c
|
|
640
|
-
});
|
|
641
|
-
}), m) {
|
|
642
|
-
let e = j(p);
|
|
643
|
-
i.push(` PRIMARY KEY (${f(e, d)})${g ? "," : ""}`);
|
|
644
|
-
}
|
|
645
|
-
s.forEach((e, t) => {
|
|
646
|
-
i.push(...e), t !== s.length - 1 && (i[i.length - 1] += ",");
|
|
647
|
-
});
|
|
648
|
-
let _ = b(a, c);
|
|
649
|
-
_ === "" ? i.push(");") : i.push(`) COMMENT ${e(_)};`);
|
|
650
|
-
}
|
|
651
|
-
function hn(e, t, n) {
|
|
652
|
-
let r = K(e);
|
|
653
|
-
return `CONSTRAINT ${r}UQ_${N(t.name, e)}_${n.name}${r} UNIQUE (${r}${n.name}${r})`;
|
|
654
|
-
}
|
|
655
|
-
function gn({ settings: { bracketType: e }, collections: t }, { buffer: r, table: i }) {
|
|
656
|
-
let a = K(e), o = n(t).collection("tableColumnEntities").selectByIds(i.columnIds);
|
|
657
|
-
ge(o) && H(o).forEach((t) => {
|
|
658
|
-
r.push(`ALTER TABLE ${a}${i.name}${a}`), r.push(` ADD ${hn(e, i, t)};`), r.push("");
|
|
659
|
-
});
|
|
660
|
-
}
|
|
661
|
-
function _n({ settings: { bracketType: t } }, { buffer: n, column: r, isComma: i, spaceSize: a, logicalNameAsComment: o }) {
|
|
662
|
-
let s = K(t), c = [];
|
|
663
|
-
c.push(` ${s}${r.name}${s}` + O(a.name - r.name.length)), c.push(`${r.dataType}` + O(a.dataType - r.dataType.length)), c.push(`${L(r.options, z.notNull) ? "NOT NULL" : "NULL "}`), L(r.options, z.autoIncrement) ? c.push("AUTO_INCREMENT") : r.default.trim() !== "" && c.push(`DEFAULT ${E(r.default, F.MySQL, r.dataType)}`);
|
|
664
|
-
let l = b(r, o);
|
|
665
|
-
l !== "" && c.push(`COMMENT ${e(l)}`), n.push(c.join(" ") + `${i ? "," : ""}`);
|
|
666
|
-
}
|
|
667
|
-
function vn(e, t, n) {
|
|
668
|
-
let { settings: { bracketType: r } } = e, i = M(e, t);
|
|
669
|
-
if (!i) return null;
|
|
670
|
-
let { startTable: a, endTable: o } = i, s = K(r), c = N(a.name, r), l = N(o.name, r), u = R(n, `FK_${c}_TO_${l}`);
|
|
671
|
-
return n.push({
|
|
672
|
-
id: x(),
|
|
673
|
-
name: u
|
|
674
|
-
}), {
|
|
675
|
-
table: o,
|
|
676
|
-
lines: [
|
|
677
|
-
`CONSTRAINT ${s}${u}${s}`,
|
|
678
|
-
` FOREIGN KEY (${f(i.end, s)})`,
|
|
679
|
-
` REFERENCES ${s}${a.name}${s} (${f(i.start, s)})`,
|
|
680
|
-
...g(t, cn).map((e) => ` ${e}`)
|
|
681
|
-
]
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
function yn(e, { buffer: t, relationship: n, fkNames: r }) {
|
|
685
|
-
let i = vn(e, n, r);
|
|
686
|
-
if (!i) return !1;
|
|
687
|
-
let a = K(e.settings.bracketType), [o, ...s] = i.lines;
|
|
688
|
-
return t.push(`ALTER TABLE ${a}${i.table.name}${a}`, ` ADD ${o}`, ...s), t[t.length - 1] += ";", !0;
|
|
689
|
-
}
|
|
690
|
-
function bn({ settings: { bracketType: e }, collections: t }, r, i) {
|
|
691
|
-
let a = K(e), o = n(t).collection("tableEntities").selectById(r.tableId);
|
|
692
|
-
if (!o) return null;
|
|
693
|
-
let s = v(t, o, r).map(({ indexColumn: e, column: t }) => ({ name: `${a}${t.name}${a} ${P(e.orderType)}` }));
|
|
694
|
-
if (s.length === 0) return null;
|
|
695
|
-
let c = r.name;
|
|
696
|
-
if (r.name.trim() === "") {
|
|
697
|
-
let t = N(o.name, e);
|
|
698
|
-
c = R(i, `IDX_${t}`), i.push({
|
|
699
|
-
id: x(),
|
|
700
|
-
name: c
|
|
701
|
-
});
|
|
702
|
-
}
|
|
703
|
-
return {
|
|
704
|
-
table: o,
|
|
705
|
-
name: `${a}${c}${a}`,
|
|
706
|
-
columns: f(s)
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
function xn(e, { buffer: t, index: n, indexNames: r }) {
|
|
710
|
-
let i = bn(e, n, r);
|
|
711
|
-
if (!i) return;
|
|
712
|
-
let a = K(e.settings.bracketType);
|
|
713
|
-
t.push(`CREATE ${n.unique ? "UNIQUE " : ""}INDEX ${i.name}`), t.push(` ON ${a}${i.table.name}${a} (${i.columns});`);
|
|
714
|
-
}
|
|
715
|
-
function Sn({ settings: { bracketType: e } }, t, n) {
|
|
716
|
-
let r = K(e), i = `${r}${n}${r}`, a = `USE ${i};`;
|
|
717
|
-
return t === B.createAndUse ? `CREATE DATABASE IF NOT EXISTS ${i};\n${a}` : a;
|
|
718
|
-
}
|
|
719
|
-
function Cn({ settings: { bracketType: e } }, { tables: t }) {
|
|
720
|
-
if (t.length === 0) return "";
|
|
721
|
-
let n = K(e);
|
|
722
|
-
return [
|
|
723
|
-
ln,
|
|
724
|
-
t.map((e) => `DROP TABLE IF EXISTS ${n}${e.name}${n};`).join("\n"),
|
|
725
|
-
un
|
|
726
|
-
].join("\n\n");
|
|
727
|
-
}
|
|
728
|
-
//#endregion
|
|
729
|
-
//#region src/utils/schema-sql/MariaDB.ts
|
|
730
|
-
var wn = h(F.MariaDB);
|
|
731
|
-
function Tn(e, t, { statements: n, written: r, logicalNameAsComment: i } = {}) {
|
|
732
|
-
let a = [], o = [], s = [""], { tables: c, relationships: l, indexes: u } = D(e, t);
|
|
733
|
-
return c.forEach((t) => {
|
|
734
|
-
r?.tables.push(t), En(e, {
|
|
735
|
-
table: t,
|
|
736
|
-
buffer: s,
|
|
737
|
-
statements: n,
|
|
738
|
-
logicalNameAsComment: i
|
|
739
|
-
}), s.push(""), Dn(e, {
|
|
740
|
-
table: t,
|
|
741
|
-
buffer: s,
|
|
742
|
-
statements: n
|
|
743
|
-
});
|
|
744
|
-
}), l.forEach((t) => {
|
|
745
|
-
kn(e, {
|
|
746
|
-
relationship: t,
|
|
747
|
-
buffer: s,
|
|
748
|
-
fkNames: a,
|
|
749
|
-
statements: n
|
|
750
|
-
}) && s.push("");
|
|
751
|
-
}), u.forEach((t) => {
|
|
752
|
-
An(e, {
|
|
753
|
-
index: t,
|
|
754
|
-
buffer: s,
|
|
755
|
-
indexNames: o,
|
|
756
|
-
statements: n
|
|
757
|
-
}), s.push("");
|
|
758
|
-
}), s.join("\n");
|
|
759
|
-
}
|
|
760
|
-
function En(t, { buffer: i, table: a, statements: o, logicalNameAsComment: s }) {
|
|
761
|
-
let { settings: { bracketType: c }, collections: l } = t, u = K(c), d = n(l).collection("tableColumnEntities").selectByIds(a.columnIds);
|
|
762
|
-
i.push(`CREATE TABLE${r(o)} ${u}${a.name}${u}`), i.push("(");
|
|
763
|
-
let p = A(d), m = y(d);
|
|
764
|
-
if (d.forEach((e, n) => {
|
|
765
|
-
p ? On(t, {
|
|
766
|
-
column: e,
|
|
767
|
-
isComma: !0,
|
|
768
|
-
spaceSize: m,
|
|
769
|
-
buffer: i,
|
|
770
|
-
logicalNameAsComment: s
|
|
771
|
-
}) : On(t, {
|
|
772
|
-
column: e,
|
|
773
|
-
isComma: d.length !== n + 1,
|
|
774
|
-
spaceSize: m,
|
|
775
|
-
buffer: i,
|
|
776
|
-
logicalNameAsComment: s
|
|
777
|
-
});
|
|
778
|
-
}), p) {
|
|
779
|
-
let e = j(d);
|
|
780
|
-
i.push(` PRIMARY KEY (${f(e, u)})`);
|
|
781
|
-
}
|
|
782
|
-
let h = b(a, s);
|
|
783
|
-
h === "" ? i.push(");") : i.push(`) COMMENT ${e(h)};`);
|
|
784
|
-
}
|
|
785
|
-
function Dn({ settings: { bracketType: e }, collections: t }, { buffer: i, table: a, statements: o }) {
|
|
786
|
-
let s = K(e), c = n(t).collection("tableColumnEntities").selectByIds(a.columnIds);
|
|
787
|
-
ge(c) && H(c).forEach((t) => {
|
|
788
|
-
i.push(`ALTER TABLE ${s}${a.name}${s}`), i.push(` ADD CONSTRAINT ${s}UQ_${N(a.name, e)}_${t.name}${s} UNIQUE${r(o)} (${s}${t.name}${s});`), i.push("");
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
function On({ settings: { bracketType: t } }, { buffer: n, column: r, isComma: i, spaceSize: a, logicalNameAsComment: o }) {
|
|
792
|
-
let s = K(t), c = [];
|
|
793
|
-
c.push(` ${s}${r.name}${s}` + O(a.name - r.name.length)), c.push(`${r.dataType}` + O(a.dataType - r.dataType.length)), c.push(`${L(r.options, z.notNull) ? "NOT NULL" : "NULL "}`), L(r.options, z.autoIncrement) ? c.push("AUTO_INCREMENT") : r.default.trim() !== "" && c.push(`DEFAULT ${E(r.default, F.MariaDB)}`);
|
|
794
|
-
let l = b(r, o);
|
|
795
|
-
l !== "" && c.push(`COMMENT ${e(l)}`), n.push(c.join(" ") + `${i ? "," : ""}`);
|
|
796
|
-
}
|
|
797
|
-
function kn(e, { buffer: t, relationship: n, fkNames: i, statements: a }) {
|
|
798
|
-
let { settings: { bracketType: o } } = e, s = M(e, n);
|
|
799
|
-
if (!s) return !1;
|
|
800
|
-
let { startTable: c, endTable: l } = s, u = K(o);
|
|
801
|
-
t.push(`ALTER TABLE ${u}${l.name}${u}`);
|
|
802
|
-
let d = N(c.name, o), p = N(l.name, o), m = R(i, `FK_${d}_TO_${p}`);
|
|
803
|
-
return i.push({
|
|
804
|
-
id: x(),
|
|
805
|
-
name: m
|
|
806
|
-
}), t.push(` ADD CONSTRAINT ${u}${m}${u}`), t.push(` FOREIGN KEY${r(a)} (${f(s.end, u)})`), t.push(` REFERENCES ${u}${c.name}${u} (${f(s.start, u)})`, ...g(n, wn).map((e) => ` ${e}`)), t[t.length - 1] += ";", !0;
|
|
807
|
-
}
|
|
808
|
-
function An({ settings: { bracketType: e }, collections: t }, { buffer: i, index: a, indexNames: o, statements: s }) {
|
|
809
|
-
let c = K(e), l = n(t).collection("tableEntities").selectById(a.tableId);
|
|
810
|
-
if (!l) return;
|
|
811
|
-
let u = v(t, l, a).map(({ indexColumn: e, column: t }) => ({ name: `${c}${t.name}${c} ${P(e.orderType)}` }));
|
|
812
|
-
if (u.length !== 0) {
|
|
813
|
-
let t = a.name;
|
|
814
|
-
if (a.name.trim() === "") {
|
|
815
|
-
let n = N(l.name, e);
|
|
816
|
-
t = R(o, `IDX_${n}`), o.push({
|
|
817
|
-
id: x(),
|
|
818
|
-
name: t
|
|
819
|
-
});
|
|
820
|
-
}
|
|
821
|
-
i.push(`CREATE ${a.unique ? "UNIQUE " : ""}INDEX${r(s)} ${c}${t}${c}`), i.push(` ON ${c}${l.name}${c} (${f(u)});`);
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
//#endregion
|
|
825
|
-
//#region src/utils/schema-sql/MSSQL.ts
|
|
826
|
-
var jn = h(F.MSSQL), Mn = "dbo";
|
|
827
|
-
function Nn(e, t, { written: n, logicalNameAsComment: r } = {}) {
|
|
828
|
-
let i = [], a = [], o = [""], { tables: s, relationships: c, indexes: l } = D(e, t);
|
|
829
|
-
return s.forEach((t) => {
|
|
830
|
-
n?.tables.push(t), Pn(e, {
|
|
831
|
-
table: t,
|
|
832
|
-
buffer: o
|
|
833
|
-
}), o.push(""), Fn(e, {
|
|
834
|
-
table: t,
|
|
835
|
-
buffer: o
|
|
836
|
-
}), Hn(e, {
|
|
837
|
-
table: t,
|
|
838
|
-
buffer: o,
|
|
839
|
-
logicalNameAsComment: r
|
|
840
|
-
});
|
|
841
|
-
}), c.forEach((t) => {
|
|
842
|
-
Un(e, {
|
|
843
|
-
relationship: t,
|
|
844
|
-
buffer: o,
|
|
845
|
-
fkNames: i
|
|
846
|
-
}) && o.push("");
|
|
847
|
-
}), l.forEach((t) => {
|
|
848
|
-
Wn(e, {
|
|
849
|
-
index: t,
|
|
850
|
-
buffer: o,
|
|
851
|
-
indexNames: a
|
|
852
|
-
}), o.push("");
|
|
853
|
-
}), o.join("\n");
|
|
854
|
-
}
|
|
855
|
-
function Pn(e, { buffer: t, table: r }) {
|
|
856
|
-
let { settings: { bracketType: i }, collections: a } = e, o = K(i), s = n(a).collection("tableColumnEntities").selectByIds(r.columnIds);
|
|
857
|
-
t.push(`CREATE TABLE ${o}${r.name}${o}`), t.push("(");
|
|
858
|
-
let c = A(s), l = y(s);
|
|
859
|
-
if (s.forEach((n, r) => {
|
|
860
|
-
c ? In(e, {
|
|
861
|
-
column: n,
|
|
862
|
-
isComma: !0,
|
|
863
|
-
spaceSize: l,
|
|
864
|
-
buffer: t
|
|
865
|
-
}) : In(e, {
|
|
866
|
-
column: n,
|
|
867
|
-
isComma: s.length !== r + 1,
|
|
868
|
-
spaceSize: l,
|
|
869
|
-
buffer: t
|
|
870
|
-
});
|
|
871
|
-
}), c) {
|
|
872
|
-
let e = j(s), n = `PK_${N(r.name, i)}`;
|
|
873
|
-
t.push(` CONSTRAINT ${o}${n}${o} PRIMARY KEY (${f(e, o)})`);
|
|
874
|
-
}
|
|
875
|
-
t.push(")\nGO");
|
|
876
|
-
}
|
|
877
|
-
function Fn({ settings: { bracketType: e }, collections: t }, { buffer: r, table: i }) {
|
|
878
|
-
let a = K(e), o = n(t).collection("tableColumnEntities").selectByIds(i.columnIds);
|
|
879
|
-
ge(o) && H(o).forEach((t) => {
|
|
880
|
-
r.push(`ALTER TABLE ${a}${i.name}${a}`), r.push(` ADD CONSTRAINT ${a}UQ_${N(i.name, e)}_${t.name}${a} UNIQUE (${a}${t.name}${a})\nGO`), r.push("");
|
|
881
|
-
});
|
|
882
|
-
}
|
|
883
|
-
function In({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: i }) {
|
|
884
|
-
let a = K(e), o = [];
|
|
885
|
-
o.push(` ${a}${n.name}${a}` + O(i.name - n.name.length)), o.push(`${n.dataType}` + O(i.dataType - n.dataType.length)), L(n.options, z.notNull) && o.push("NOT NULL"), L(n.options, z.autoIncrement) ? o.push("IDENTITY(1,1)") : n.default.trim() !== "" && o.push(`DEFAULT ${n.default}`), t.push(o.join(" ") + `${r ? "," : ""}`);
|
|
886
|
-
}
|
|
887
|
-
var Ln = /^[\p{L}_@#][\p{L}\p{N}_@#$]*$/u;
|
|
888
|
-
function Rn(e) {
|
|
889
|
-
return le(e) || Ln.test(e);
|
|
890
|
-
}
|
|
891
|
-
function zn(e, t) {
|
|
892
|
-
if (t) return "";
|
|
893
|
-
let [, , n = ""] = Ee(e).reverse();
|
|
894
|
-
return Rn(n) ? `${n}.` : "";
|
|
895
|
-
}
|
|
896
|
-
function Bn(t, n) {
|
|
897
|
-
let [r, i = ""] = n ? [t] : Ee(t).reverse(), a = we(i) || Mn, o = n ? r : we(r);
|
|
898
|
-
return {
|
|
899
|
-
procedure: `${zn(t, n)}sys.sp_addextendedproperty`,
|
|
900
|
-
levels: `'schema', ${e(a)}, 'table', ${e(o)}`
|
|
901
|
-
};
|
|
902
|
-
}
|
|
903
|
-
var Vn = (t) => `N${e(t)}`;
|
|
904
|
-
function Hn({ settings: { bracketType: t }, collections: r }, { table: i, buffer: a, logicalNameAsComment: o }) {
|
|
905
|
-
let { procedure: s, levels: c } = Bn(i.name, K(t)), l = b(i, o);
|
|
906
|
-
l !== "" && (a.push(`EXECUTE ${s} 'MS_Description',`), a.push(` ${Vn(l)}, ${c}\nGO`), a.push("")), n(r).collection("tableColumnEntities").selectByIds(i.columnIds).forEach((t) => {
|
|
907
|
-
let n = b(t, o);
|
|
908
|
-
n !== "" && (a.push(`EXECUTE ${s} 'MS_Description',`), a.push(` ${Vn(n)}, ${c}, 'column', ${e(t.name)}\nGO`), a.push(""));
|
|
909
|
-
});
|
|
910
|
-
}
|
|
911
|
-
function Un(e, { buffer: t, relationship: n, fkNames: r }) {
|
|
912
|
-
let { settings: { bracketType: i } } = e, a = M(e, n);
|
|
913
|
-
if (!a) return !1;
|
|
914
|
-
let { startTable: o, endTable: s } = a, c = K(i);
|
|
915
|
-
t.push(`ALTER TABLE ${c}${s.name}${c}`);
|
|
916
|
-
let l = N(o.name, i), u = N(s.name, i), d = R(r, `FK_${l}_TO_${u}`);
|
|
917
|
-
return r.push({
|
|
918
|
-
id: x(),
|
|
919
|
-
name: d
|
|
920
|
-
}), t.push(` ADD CONSTRAINT ${c}${d}${c}`), t.push(` FOREIGN KEY (${f(a.end, c)})`), t.push(` REFERENCES ${c}${o.name}${c} (${f(a.start, c)})`, ...g(n, jn).map((e) => ` ${e}`)), t[t.length - 1] += "\nGO", !0;
|
|
921
|
-
}
|
|
922
|
-
function Wn({ settings: { bracketType: e }, collections: t }, { buffer: r, index: i, indexNames: a }) {
|
|
923
|
-
let o = K(e), s = n(t).collection("tableEntities").selectById(i.tableId);
|
|
924
|
-
if (!s) return;
|
|
925
|
-
let c = v(t, s, i).map(({ indexColumn: e, column: t }) => ({ name: `${o}${t.name}${o} ${P(e.orderType)}` }));
|
|
926
|
-
if (c.length !== 0) {
|
|
927
|
-
let t = i.name;
|
|
928
|
-
if (i.name.trim() === "") {
|
|
929
|
-
let n = N(s.name, e);
|
|
930
|
-
t = R(a, `IDX_${n}`), a.push({
|
|
931
|
-
id: x(),
|
|
932
|
-
name: t
|
|
933
|
-
});
|
|
934
|
-
}
|
|
935
|
-
i.unique ? r.push(`CREATE UNIQUE INDEX ${o}${t}${o}`) : r.push(`CREATE INDEX ${o}${t}${o}`), r.push(` ON ${o}${s.name}${o} (${f(c)})\nGO`);
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
function Gn({ settings: { bracketType: t } }, n, r) {
|
|
939
|
-
let i = K(t), a = `${i}${r}${i}`, o = `USE ${a}\nGO`;
|
|
940
|
-
return n === B.createAndUse ? `IF DB_ID(N${e(r)}) IS NULL\n CREATE DATABASE ${a}\nGO\n\n${o}` : o;
|
|
941
|
-
}
|
|
942
|
-
function Kn({ settings: { bracketType: t } }, { tables: n }) {
|
|
943
|
-
if (n.length === 0) return "";
|
|
944
|
-
let r = K(t), i = (e) => `${r}${e}${r}`;
|
|
945
|
-
return [
|
|
946
|
-
"BEGIN TRY",
|
|
947
|
-
" BEGIN TRANSACTION",
|
|
948
|
-
"",
|
|
949
|
-
" DECLARE @sql NVARCHAR(MAX) = N''",
|
|
950
|
-
...n.flatMap(({ name: t }) => {
|
|
951
|
-
let n = zn(t, r), a = `OBJECT_ID(N${e(i(t))}, N'U')`, o = [
|
|
952
|
-
`SELECT @sql += N${e(`ALTER TABLE ${i(t)} DROP CONSTRAINT `)} + QUOTENAME(name) + N';'`,
|
|
953
|
-
` FROM ${n}sys.foreign_keys`,
|
|
954
|
-
` WHERE parent_object_id = ${a}`
|
|
955
|
-
];
|
|
956
|
-
return n ? [` IF ${a} IS NOT NULL`, ...o.map((e) => ` ${e}`)] : o.map((e) => ` ${e}`);
|
|
957
|
-
}),
|
|
958
|
-
" EXECUTE sp_executesql @sql",
|
|
959
|
-
"",
|
|
960
|
-
` DROP TABLE IF EXISTS ${n.map(({ name: e }) => i(e)).join(", ")}`,
|
|
961
|
-
"",
|
|
962
|
-
" COMMIT TRANSACTION",
|
|
963
|
-
"END TRY",
|
|
964
|
-
"BEGIN CATCH",
|
|
965
|
-
" IF @@TRANCOUNT > 0 ROLLBACK TRANSACTION;",
|
|
966
|
-
" THROW;",
|
|
967
|
-
"END CATCH",
|
|
968
|
-
"GO"
|
|
969
|
-
].join("\n");
|
|
970
|
-
}
|
|
971
|
-
//#endregion
|
|
972
|
-
//#region src/utils/schema-sql/Oracle.ts
|
|
973
|
-
var qn = h(F.Oracle);
|
|
974
|
-
function Jn(e, r, { written: i, logicalNameAsComment: a } = {}) {
|
|
975
|
-
let { settings: { bracketType: o }, collections: s } = e, c = [], l = [], u = [], d = [], f = [""], { tables: p, relationships: m, indexes: h } = D(e, r);
|
|
976
|
-
return p.forEach((r) => {
|
|
977
|
-
i?.tables.push(r), Yn(e, {
|
|
978
|
-
table: r,
|
|
979
|
-
buffer: f,
|
|
980
|
-
written: i
|
|
981
|
-
}), f.push(""), Xn(e, {
|
|
982
|
-
table: r,
|
|
983
|
-
buffer: f,
|
|
984
|
-
written: i
|
|
985
|
-
});
|
|
986
|
-
let c = n(s).collection("tableColumnEntities").selectByIds(r.columnIds), [d] = _(r.name, o), p = N(r.name, o), m = d === "" ? "" : `${d}.`;
|
|
987
|
-
c.forEach((e) => {
|
|
988
|
-
if (L(e.options, z.autoIncrement)) {
|
|
989
|
-
let n = t(l, "", `SEQ_${p}`);
|
|
990
|
-
l.push({
|
|
991
|
-
id: x(),
|
|
992
|
-
name: n
|
|
993
|
-
});
|
|
994
|
-
let a = `${m}${n}`;
|
|
995
|
-
i?.sequences.push(a), i?.identifiers.push(n), f.push(`CREATE SEQUENCE ${a}`), f.push("START WITH 1"), f.push("INCREMENT BY 1;"), f.push("");
|
|
996
|
-
let o = t(l, "", `SEQ_TRG_${p}`);
|
|
997
|
-
u.push({
|
|
998
|
-
id: x(),
|
|
999
|
-
name: o
|
|
1000
|
-
}), i?.identifiers.push(o), f.push(`CREATE OR REPLACE TRIGGER ${m}${o}`), f.push(`BEFORE INSERT ON ${r.name}`), f.push("REFERENCING NEW AS NEW FOR EACH ROW"), f.push("BEGIN"), f.push(` SELECT ${a}.NEXTVAL`), f.push(` INTO :NEW.${e.name}`), f.push(" FROM DUAL;"), f.push("END;"), f.push("/"), f.push("");
|
|
1001
|
-
}
|
|
1002
|
-
}), $n(e, {
|
|
1003
|
-
table: r,
|
|
1004
|
-
buffer: f,
|
|
1005
|
-
logicalNameAsComment: a
|
|
1006
|
-
});
|
|
1007
|
-
}), m.forEach((t) => {
|
|
1008
|
-
er(e, {
|
|
1009
|
-
relationship: t,
|
|
1010
|
-
buffer: f,
|
|
1011
|
-
fkNames: c,
|
|
1012
|
-
written: i
|
|
1013
|
-
}) && f.push("");
|
|
1014
|
-
}), h.forEach((t) => {
|
|
1015
|
-
tr(e, {
|
|
1016
|
-
index: t,
|
|
1017
|
-
buffer: f,
|
|
1018
|
-
indexNames: d,
|
|
1019
|
-
written: i
|
|
1020
|
-
}), f.push("");
|
|
1021
|
-
}), f.join("\n");
|
|
1022
|
-
}
|
|
1023
|
-
function Yn(e, { buffer: t, table: r, written: i }) {
|
|
1024
|
-
let { settings: { bracketType: a }, collections: o } = e, s = K(a), c = n(o).collection("tableColumnEntities").selectByIds(r.columnIds);
|
|
1025
|
-
if (i) {
|
|
1026
|
-
let [e, t] = _(r.name, a);
|
|
1027
|
-
e !== "" && i.identifiers.push(we(e)), i.identifiers.push(we(t)), i.identifiers.push(...c.map((e) => e.name));
|
|
1028
|
-
}
|
|
1029
|
-
t.push(`CREATE TABLE ${s}${r.name}${s}`), t.push("(");
|
|
1030
|
-
let l = A(c), u = y(c);
|
|
1031
|
-
if (c.forEach((n, r) => {
|
|
1032
|
-
l ? Zn(e, {
|
|
1033
|
-
column: n,
|
|
1034
|
-
isComma: !0,
|
|
1035
|
-
spaceSize: u,
|
|
1036
|
-
buffer: t
|
|
1037
|
-
}) : Zn(e, {
|
|
1038
|
-
column: n,
|
|
1039
|
-
isComma: c.length !== r + 1,
|
|
1040
|
-
spaceSize: u,
|
|
1041
|
-
buffer: t
|
|
1042
|
-
});
|
|
1043
|
-
}), l) {
|
|
1044
|
-
let e = j(c), n = `PK_${N(r.name, a)}`;
|
|
1045
|
-
i?.identifiers.push(n), t.push(` CONSTRAINT ${s}${n}${s} PRIMARY KEY (${f(e, s)})`);
|
|
1046
|
-
}
|
|
1047
|
-
t.push(");");
|
|
1048
|
-
}
|
|
1049
|
-
function Xn({ settings: { bracketType: e }, collections: t }, { buffer: r, table: i, written: a }) {
|
|
1050
|
-
let o = K(e), s = n(t).collection("tableColumnEntities").selectByIds(i.columnIds);
|
|
1051
|
-
ge(s) && H(s).forEach((t) => {
|
|
1052
|
-
let n = `UQ_${N(i.name, e)}_${t.name}`;
|
|
1053
|
-
a?.identifiers.push(n), r.push(`ALTER TABLE ${o}${i.name}${o}`), r.push(` ADD CONSTRAINT ${o}${n}${o} UNIQUE (${o}${t.name}${o});`), r.push("");
|
|
1054
|
-
});
|
|
1055
|
-
}
|
|
1056
|
-
function Zn({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: i }) {
|
|
1057
|
-
let a = K(e), o = [];
|
|
1058
|
-
o.push(` ${a}${n.name}${a}` + O(i.name - n.name.length)), o.push(`${n.dataType}` + O(i.dataType - n.dataType.length)), n.default.trim() !== "" && o.push(`DEFAULT ${n.default}`), L(n.options, z.notNull) && o.push("NOT NULL"), t.push(o.join(" ") + `${r ? "," : ""}`);
|
|
1059
|
-
}
|
|
1060
|
-
var Qn = (t) => e(t.replace(/(\r?\n)(?:[ \t\r]*\n)+/g, "$1"));
|
|
1061
|
-
function $n({ settings: { bracketType: e }, collections: t }, { table: r, buffer: i, logicalNameAsComment: a }) {
|
|
1062
|
-
let o = K(e), s = b(r, a);
|
|
1063
|
-
s !== "" && (i.push(`COMMENT ON TABLE ${o}${r.name}${o} IS ${Qn(s)};`), i.push("")), n(t).collection("tableColumnEntities").selectByIds(r.columnIds).forEach((e) => {
|
|
1064
|
-
let t = b(e, a);
|
|
1065
|
-
t !== "" && (i.push(`COMMENT ON COLUMN ${o}${r.name}${o}.${o}${e.name}${o} IS ${Qn(t)};`), i.push(""));
|
|
1066
|
-
});
|
|
1067
|
-
}
|
|
1068
|
-
function er(e, { buffer: t, relationship: n, fkNames: r, written: i }) {
|
|
1069
|
-
let { settings: { bracketType: a } } = e, o = M(e, n);
|
|
1070
|
-
if (!o) return !1;
|
|
1071
|
-
let { startTable: s, endTable: c } = o, l = K(a);
|
|
1072
|
-
t.push(`ALTER TABLE ${l}${c.name}${l}`);
|
|
1073
|
-
let u = N(s.name, a), d = N(c.name, a), p = R(r, `FK_${u}_TO_${d}`);
|
|
1074
|
-
return r.push({
|
|
1075
|
-
id: x(),
|
|
1076
|
-
name: p
|
|
1077
|
-
}), i?.identifiers.push(p), t.push(` ADD CONSTRAINT ${l}${p}${l}`), t.push(` FOREIGN KEY (${f(o.end, l)})`), t.push(` REFERENCES ${l}${s.name}${l} (${f(o.start, l)})`, ...g(n, qn).map((e) => ` ${e}`)), t[t.length - 1] += ";", !0;
|
|
1078
|
-
}
|
|
1079
|
-
function tr({ settings: { bracketType: e }, collections: t }, { buffer: r, index: i, indexNames: a, written: o }) {
|
|
1080
|
-
let s = K(e), c = n(t).collection("tableEntities").selectById(i.tableId);
|
|
1081
|
-
if (!c) return;
|
|
1082
|
-
let l = v(t, c, i).map(({ indexColumn: e, column: t }) => ({ name: `${s}${t.name}${s} ${P(e.orderType)}` }));
|
|
1083
|
-
if (l.length !== 0) {
|
|
1084
|
-
let [t] = _(c.name, e), n = i.name;
|
|
1085
|
-
if (i.name.trim() === "") {
|
|
1086
|
-
let t = N(c.name, e);
|
|
1087
|
-
n = R(a, `IDX_${t}`), a.push({
|
|
1088
|
-
id: x(),
|
|
1089
|
-
name: n
|
|
1090
|
-
});
|
|
1091
|
-
}
|
|
1092
|
-
let u = `${t === "" || n.includes(".") ? "" : `${t}.`}${s}${n}${s}`;
|
|
1093
|
-
o?.identifiers.push(n.slice(n.lastIndexOf(".") + 1)), i.unique ? r.push(`CREATE UNIQUE INDEX ${u}`) : r.push(`CREATE INDEX ${u}`), r.push(` ON ${s}${c.name}${s} (${f(l)});`);
|
|
1094
|
-
}
|
|
1095
|
-
}
|
|
1096
|
-
function nr(e, t) {
|
|
1097
|
-
let n = C();
|
|
1098
|
-
Jn(e, t, { written: n });
|
|
1099
|
-
let r = new TextEncoder();
|
|
1100
|
-
return [...new Set(n.identifiers)].filter((e) => r.encode(e).length > 30);
|
|
1101
|
-
}
|
|
1102
|
-
function rr({ settings: { bracketType: e } }, t, n) {
|
|
1103
|
-
if (t !== B.use) return "";
|
|
1104
|
-
let r = K(e);
|
|
1105
|
-
return `ALTER SESSION SET CURRENT_SCHEMA = ${r}${n}${r};`;
|
|
1106
|
-
}
|
|
1107
|
-
function ir(t, n) {
|
|
1108
|
-
return [
|
|
1109
|
-
"BEGIN",
|
|
1110
|
-
` EXECUTE IMMEDIATE ${e(t)};`,
|
|
1111
|
-
"EXCEPTION WHEN OTHERS THEN",
|
|
1112
|
-
` IF SQLCODE != ${n} THEN RAISE; END IF;`,
|
|
1113
|
-
"END;",
|
|
1114
|
-
"/"
|
|
1115
|
-
].join("\n");
|
|
1116
|
-
}
|
|
1117
|
-
function ar({ settings: { bracketType: e } }, { tables: t, sequences: n }) {
|
|
1118
|
-
if (t.length === 0) return "";
|
|
1119
|
-
let r = K(e);
|
|
1120
|
-
return [...t.map(({ name: e }) => ir(`DROP TABLE ${r}${e}${r} CASCADE CONSTRAINTS`, -942)), ...n.map((e) => ir(`DROP SEQUENCE ${e}`, -2289))].join("\n\n");
|
|
1121
|
-
}
|
|
1122
|
-
//#endregion
|
|
1123
|
-
//#region src/utils/schema-sql/PostgreSQL.ts
|
|
1124
|
-
var or = h(F.PostgreSQL), sr = /* @__PURE__ */ new Set([
|
|
1125
|
-
"INT",
|
|
1126
|
-
"INTEGER",
|
|
1127
|
-
"BIGINT",
|
|
1128
|
-
"SMALLINT",
|
|
1129
|
-
"INT2",
|
|
1130
|
-
"INT4",
|
|
1131
|
-
"INT8"
|
|
1132
|
-
]);
|
|
1133
|
-
function cr(e) {
|
|
1134
|
-
return L(e.options, z.autoIncrement) && sr.has(e.dataType.trim().toUpperCase());
|
|
1135
|
-
}
|
|
1136
|
-
function lr(e, t, { statements: n, written: r, logicalNameAsComment: i } = {}) {
|
|
1137
|
-
let a = [], o = [], s = [""], { tables: c, relationships: l, indexes: u } = D(e, t);
|
|
1138
|
-
return c.forEach((t) => {
|
|
1139
|
-
r?.tables.push(t), ur(e, {
|
|
1140
|
-
table: t,
|
|
1141
|
-
buffer: s,
|
|
1142
|
-
statements: n
|
|
1143
|
-
}), s.push(""), fr(e, {
|
|
1144
|
-
table: t,
|
|
1145
|
-
buffer: s,
|
|
1146
|
-
logicalNameAsComment: i
|
|
1147
|
-
});
|
|
1148
|
-
}), l.forEach((t) => {
|
|
1149
|
-
pr(e, {
|
|
1150
|
-
relationship: t,
|
|
1151
|
-
buffer: s,
|
|
1152
|
-
fkNames: a,
|
|
1153
|
-
statements: n
|
|
1154
|
-
}) && s.push("");
|
|
1155
|
-
}), u.forEach((t) => {
|
|
1156
|
-
mr(e, {
|
|
1157
|
-
index: t,
|
|
1158
|
-
buffer: s,
|
|
1159
|
-
indexNames: o,
|
|
1160
|
-
statements: n
|
|
1161
|
-
}), s.push("");
|
|
1162
|
-
}), s.join("\n");
|
|
1163
|
-
}
|
|
1164
|
-
function ur(e, { buffer: t, table: i, statements: a }) {
|
|
1165
|
-
let { settings: { bracketType: o }, collections: s } = e, c = K(o), l = n(s).collection("tableColumnEntities").selectByIds(i.columnIds);
|
|
1166
|
-
t.push(`CREATE TABLE${r(a)} ${c}${i.name}${c}`), t.push("(");
|
|
1167
|
-
let u = A(l), d = y(l);
|
|
1168
|
-
if (l.forEach((n, r) => {
|
|
1169
|
-
u ? dr(e, {
|
|
1170
|
-
column: n,
|
|
1171
|
-
isComma: !0,
|
|
1172
|
-
spaceSize: d,
|
|
1173
|
-
buffer: t
|
|
1174
|
-
}) : dr(e, {
|
|
1175
|
-
column: n,
|
|
1176
|
-
isComma: l.length !== r + 1,
|
|
1177
|
-
spaceSize: d,
|
|
1178
|
-
buffer: t
|
|
1179
|
-
});
|
|
1180
|
-
}), u) {
|
|
1181
|
-
let e = j(l);
|
|
1182
|
-
t.push(` PRIMARY KEY (${f(e, c)})`);
|
|
1183
|
-
}
|
|
1184
|
-
t.push(");");
|
|
1185
|
-
let p = l.filter((e) => L(e.options, z.autoIncrement) && !cr(e));
|
|
1186
|
-
p.length !== 0 && (t.push(""), p.forEach((e) => {
|
|
1187
|
-
t.push(`-- PostgreSQL takes IDENTITY only on smallint, integer or bigint, so ${c}${i.name}${c}.${c}${e.name}${c} is written without it.`);
|
|
1188
|
-
}));
|
|
1189
|
-
}
|
|
1190
|
-
function dr({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: i }) {
|
|
1191
|
-
let a = K(e), o = [];
|
|
1192
|
-
o.push(` ${a}${n.name}${a}` + O(i.name - n.name.length)), o.push(`${n.dataType}` + O(i.dataType - n.dataType.length)), L(n.options, z.notNull) && o.push("NOT NULL"), L(n.options, z.autoIncrement) ? cr(n) && o.push("GENERATED ALWAYS AS IDENTITY") : n.default.trim() !== "" && o.push(`DEFAULT ${E(n.default, F.PostgreSQL)}`), L(n.options, z.unique) && o.push("UNIQUE"), t.push(o.join(" ") + `${r ? "," : ""}`);
|
|
1193
|
-
}
|
|
1194
|
-
function fr({ settings: { bracketType: t }, collections: r }, { buffer: i, table: a, logicalNameAsComment: o }) {
|
|
1195
|
-
let s = K(t), c = b(a, o);
|
|
1196
|
-
c !== "" && (i.push(`COMMENT ON TABLE ${s}${a.name}${s} IS ${e(c)};`), i.push("")), n(r).collection("tableColumnEntities").selectByIds(a.columnIds).forEach((t) => {
|
|
1197
|
-
let n = b(t, o);
|
|
1198
|
-
n !== "" && (i.push(`COMMENT ON COLUMN ${s}${a.name}${s}.${s}${t.name}${s} IS ${e(n)};`), i.push(""));
|
|
1199
|
-
});
|
|
1200
|
-
}
|
|
1201
|
-
function pr(e, { buffer: t, relationship: n, fkNames: r, statements: i }) {
|
|
1202
|
-
let { settings: { bracketType: a } } = e, o = M(e, n);
|
|
1203
|
-
if (!o) return !1;
|
|
1204
|
-
let { startTable: s, endTable: c } = o, l = K(a), u = N(s.name, a), d = N(c.name, a), p = R(r, `FK_${u}_TO_${d}`);
|
|
1205
|
-
r.push({
|
|
1206
|
-
id: x(),
|
|
1207
|
-
name: p
|
|
1208
|
-
});
|
|
1209
|
-
let m = `ALTER TABLE ${l}${c.name}${l}`;
|
|
1210
|
-
return i === I.ifNotExists && t.push(`${m} DROP CONSTRAINT IF EXISTS ${l}${p}${l};`), t.push(m), t.push(` ADD CONSTRAINT ${l}${p}${l}`), t.push(` FOREIGN KEY (${f(o.end, l)})`), t.push(` REFERENCES ${l}${s.name}${l} (${f(o.start, l)})`, ...g(n, or).map((e) => ` ${e}`)), t[t.length - 1] += ";", !0;
|
|
1211
|
-
}
|
|
1212
|
-
function mr({ settings: { bracketType: e }, collections: t }, { buffer: i, index: a, indexNames: o, statements: s }) {
|
|
1213
|
-
let c = K(e), l = n(t).collection("tableEntities").selectById(a.tableId);
|
|
1214
|
-
if (!l) return;
|
|
1215
|
-
let u = v(t, l, a).map(({ indexColumn: e, column: t }) => ({ name: `${c}${t.name}${c} ${P(e.orderType)}` }));
|
|
1216
|
-
if (u.length !== 0) {
|
|
1217
|
-
let t = a.name;
|
|
1218
|
-
if (a.name.trim() === "") {
|
|
1219
|
-
let n = N(l.name, e);
|
|
1220
|
-
t = R(o, `IDX_${n}`), o.push({
|
|
1221
|
-
id: x(),
|
|
1222
|
-
name: t
|
|
1223
|
-
});
|
|
1224
|
-
}
|
|
1225
|
-
i.push(`CREATE ${a.unique ? "UNIQUE " : ""}INDEX${r(s)} ${c}${t}${c}`), i.push(` ON ${c}${l.name}${c} (${f(u)});`);
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
function hr({ settings: { bracketType: e } }, t, n) {
|
|
1229
|
-
if (t !== B.createAndUse) return "";
|
|
1230
|
-
let r = K(e), i = `${r}${n}${r}`;
|
|
1231
|
-
return `CREATE SCHEMA IF NOT EXISTS ${i};\nSET search_path TO ${i}, public;`;
|
|
1232
|
-
}
|
|
1233
|
-
function gr({ settings: { bracketType: e } }, { tables: t }, n, r) {
|
|
1234
|
-
if (t.length === 0) return "";
|
|
1235
|
-
let i = K(e), a = n === B.createAndUse ? `${i}${r}${i}.` : "";
|
|
1236
|
-
return `DROP TABLE IF EXISTS ${t.map(({ name: t }) => {
|
|
1237
|
-
let [n] = _(t, e);
|
|
1238
|
-
return `${n === "" ? a : ""}${i}${t}${i}`;
|
|
1239
|
-
}).join(", ")};`;
|
|
1240
|
-
}
|
|
1241
|
-
//#endregion
|
|
1242
|
-
//#region src/utils/schema-sql/Snowflake.ts
|
|
1243
|
-
var _r = h(F.Snowflake), $ = (e) => K(e) === "" ? "" : "\"";
|
|
1244
|
-
function vr(e, t, { statements: n, written: r, logicalNameAsComment: i } = {}) {
|
|
1245
|
-
let a = [], o = [], s = [""], { tables: c, relationships: l, indexes: u } = D(e, t);
|
|
1246
|
-
return c.forEach((t) => {
|
|
1247
|
-
r?.tables.push(t), yr(e, {
|
|
1248
|
-
table: t,
|
|
1249
|
-
buffer: s,
|
|
1250
|
-
statements: n,
|
|
1251
|
-
logicalNameAsComment: i
|
|
1252
|
-
}), s.push("");
|
|
1253
|
-
}), l.forEach((t) => {
|
|
1254
|
-
xr(e, {
|
|
1255
|
-
relationship: t,
|
|
1256
|
-
buffer: s,
|
|
1257
|
-
fkNames: a
|
|
1258
|
-
}) && s.push("");
|
|
1259
|
-
}), u.forEach((t) => {
|
|
1260
|
-
Cr(e, {
|
|
1261
|
-
index: t,
|
|
1262
|
-
buffer: s,
|
|
1263
|
-
indexNames: o
|
|
1264
|
-
}), s.push("");
|
|
1265
|
-
}), s.join("\n");
|
|
1266
|
-
}
|
|
1267
|
-
function yr(t, { buffer: r, table: i, statements: a, logicalNameAsComment: o }) {
|
|
1268
|
-
let { collections: s, settings: { bracketType: c } } = t, l = $(c), u = n(s).collection("tableColumnEntities").selectByIds(i.columnIds), d = a === I.recreate ? "CREATE OR REPLACE TABLE" : "CREATE TABLE";
|
|
1269
|
-
r.push(`${d} ${l}${i.name}${l}`), r.push("(");
|
|
1270
|
-
let p = A(u), m = y(u);
|
|
1271
|
-
if (u.forEach((e, n) => {
|
|
1272
|
-
br(t, {
|
|
1273
|
-
column: e,
|
|
1274
|
-
isComma: p || u.length !== n + 1,
|
|
1275
|
-
spaceSize: m,
|
|
1276
|
-
buffer: r,
|
|
1277
|
-
logicalNameAsComment: o
|
|
1278
|
-
});
|
|
1279
|
-
}), p) {
|
|
1280
|
-
let e = j(u);
|
|
1281
|
-
r.push(` CONSTRAINT ${l}PK_${i.name}${l} PRIMARY KEY (${f(e, l)})`);
|
|
1282
|
-
}
|
|
1283
|
-
let h = b(i, o);
|
|
1284
|
-
h === "" ? r.push(");") : (r.push(")"), r.push(`COMMENT = ${e(h)};`));
|
|
1285
|
-
}
|
|
1286
|
-
function br({ settings: { bracketType: t } }, { buffer: n, column: r, isComma: i, spaceSize: a, logicalNameAsComment: o }) {
|
|
1287
|
-
let s = $(t), c = [];
|
|
1288
|
-
c.push(` ${s}${r.name}${s}` + O(a.name - r.name.length)), c.push(`${r.dataType}` + O(a.dataType - r.dataType.length)), L(r.options, z.unique) && c.push("UNIQUE");
|
|
1289
|
-
let l = L(r.options, z.notNull) || L(r.options, z.primaryKey);
|
|
1290
|
-
c.push(l ? "NOT NULL" : " "), L(r.options, z.autoIncrement) ? c.push("AUTOINCREMENT") : r.default.trim() !== "" && c.push(`DEFAULT ${r.default}`);
|
|
1291
|
-
let u = b(r, o);
|
|
1292
|
-
u !== "" && c.push(`COMMENT ${e(u)}`), n.push(c.join(" ").trimEnd() + `${i ? "," : ""}`);
|
|
1293
|
-
}
|
|
1294
|
-
function xr(e, { buffer: n, relationship: r, fkNames: i }) {
|
|
1295
|
-
let { settings: { bracketType: a } } = e, o = M(e, r);
|
|
1296
|
-
if (!o) return !1;
|
|
1297
|
-
let { startTable: s, endTable: c } = o, l = $(a), u = Sr(r);
|
|
1298
|
-
u.length !== 0 && n.push(`-- Snowflake creates no foreign key with a referential action other than NO ACTION, so ${u.join(" and ")} ${u.length === 1 ? "is" : "are"} left out.`), n.push(`ALTER TABLE ${l}${c.name}${l}`);
|
|
1299
|
-
let d = `FK_${s.name}_TO_${c.name}`;
|
|
1300
|
-
return d = t(i, "", d), i.push({
|
|
1301
|
-
id: x(),
|
|
1302
|
-
name: d
|
|
1303
|
-
}), n.push(` ADD CONSTRAINT ${l}${d}${l}`), n.push(` FOREIGN KEY (${f(o.end, l)})`), n.push(` REFERENCES ${l}${s.name}${l} (${f(o.start, l)})`, ...g(r, _r).map((e) => ` ${e}`)), n[n.length - 1] += ";", !0;
|
|
1304
|
-
}
|
|
1305
|
-
function Sr({ onDelete: e, onUpdate: t }) {
|
|
1306
|
-
let n = [];
|
|
1307
|
-
return k[e] && !_r.onDelete.includes(e) && n.push(`ON DELETE ${k[e]}`), k[t] && !_r.onUpdate.includes(t) && n.push(`ON UPDATE ${k[t]}`), n;
|
|
1308
|
-
}
|
|
1309
|
-
function Cr({ collections: e, settings: { bracketType: r } }, { buffer: i, index: a, indexNames: o }) {
|
|
1310
|
-
let s = $(r), c = n(e).collection("tableEntities").selectById(a.tableId);
|
|
1311
|
-
if (!c) return;
|
|
1312
|
-
let l = v(e, c, a), u = l.map(({ column: e }) => e);
|
|
1313
|
-
if (u.length === 0) return;
|
|
1314
|
-
let d = a.name;
|
|
1315
|
-
if (a.name.trim() === "" && (d = `IDX_${c.name}`, d = t(o, "", d), o.push({
|
|
1316
|
-
id: x(),
|
|
1317
|
-
name: d
|
|
1318
|
-
})), a.unique) {
|
|
1319
|
-
i.push(`ALTER TABLE ${s}${c.name}${s}`), i.push(` ADD CONSTRAINT ${s}${d}${s} UNIQUE (${f(u, s)});`);
|
|
1320
|
-
return;
|
|
1321
|
-
}
|
|
1322
|
-
let p = l.map(({ indexColumn: e, column: t }) => ({ name: `${s}${t.name}${s} ${P(e.orderType)}` }));
|
|
1323
|
-
i.push(`-- Snowflake has no secondary indexes. ${s}${d}${s} on ${s}${c.name}${s} (${f(p)})`), i.push(`-- ALTER TABLE ${s}${c.name}${s} CLUSTER BY (${f(u, s)});`);
|
|
1324
|
-
}
|
|
1325
|
-
function wr({ settings: { bracketType: e } }, t, n) {
|
|
1326
|
-
let r = $(e), i = `${r}${n}${r}`, a = `USE SCHEMA ${i};`;
|
|
1327
|
-
return t === B.createAndUse ? `CREATE SCHEMA IF NOT EXISTS ${i};\n${a}` : a;
|
|
1328
|
-
}
|
|
1329
|
-
function Tr() {
|
|
1330
|
-
return "";
|
|
1331
|
-
}
|
|
1332
|
-
//#endregion
|
|
1333
|
-
//#region src/utils/schema-sql/SQLite.ts
|
|
1334
|
-
var Er = h(F.SQLite), Dr = (e) => `-- ${e.replace(/[\r\n]+/g, " ")}`;
|
|
1335
|
-
function Or(e, t, { statements: n, written: r, logicalNameAsComment: i } = {}) {
|
|
1336
|
-
let a = [], o = [""], { tables: s, indexes: c } = D(e, t);
|
|
1337
|
-
return s.forEach((t) => {
|
|
1338
|
-
r?.tables.push(t), Ar(e, {
|
|
1339
|
-
table: t,
|
|
1340
|
-
buffer: o,
|
|
1341
|
-
statements: n,
|
|
1342
|
-
logicalNameAsComment: i
|
|
1343
|
-
}), o.push("");
|
|
1344
|
-
}), c.forEach((t) => {
|
|
1345
|
-
Mr(e, {
|
|
1346
|
-
index: t,
|
|
1347
|
-
buffer: o,
|
|
1348
|
-
indexNames: a,
|
|
1349
|
-
statements: n
|
|
1350
|
-
}), o.push("");
|
|
1351
|
-
}), o.join("\n");
|
|
1352
|
-
}
|
|
1353
|
-
function kr(e) {
|
|
1354
|
-
return /^(?:(?:TINY|SMALL|MEDIUM|BIG)?INT(?:EGER)?|INT[248]|UNSIGNED\s+BIG\s+INT)(?:\s*\(\s*\d+\s*\))?$/i.test(e.trim());
|
|
1355
|
-
}
|
|
1356
|
-
function Ar(e, { buffer: t, table: i, statements: a, logicalNameAsComment: o }) {
|
|
1357
|
-
let { settings: { bracketType: s }, doc: { relationshipIds: c }, collections: l } = e, u = K(s), d = n(l).collection("tableColumnEntities").selectByIds(i.columnIds), p = j(d), m = p.length === 1 && L(p[0].options, z.autoIncrement) ? p[0] : null, h = m !== null && kr(m.dataType), v = h ? d.map((e) => e === m ? {
|
|
1358
|
-
...e,
|
|
1359
|
-
dataType: "INTEGER"
|
|
1360
|
-
} : e) : d, x = n(l).collection("relationshipEntities").selectByIds(c).filter(({ end: e }) => e.tableId === i.id).flatMap((t) => {
|
|
1361
|
-
let n = M(e, t);
|
|
1362
|
-
return n ? [{
|
|
1363
|
-
relationship: t,
|
|
1364
|
-
...n
|
|
1365
|
-
}] : [];
|
|
1366
|
-
}), S = x.length !== 0, C = b(i, o);
|
|
1367
|
-
C !== "" && t.push(Dr(C)), t.push(`CREATE TABLE${r(a)} ${u}${i.name}${u}`), t.push("(");
|
|
1368
|
-
let w = A(v), ee = y(v);
|
|
1369
|
-
if (v.forEach((n, r) => {
|
|
1370
|
-
jr(e, {
|
|
1371
|
-
column: n,
|
|
1372
|
-
isComma: w || S || v.length !== r + 1,
|
|
1373
|
-
spaceSize: ee,
|
|
1374
|
-
buffer: t,
|
|
1375
|
-
logicalNameAsComment: o
|
|
1376
|
-
});
|
|
1377
|
-
}), w) {
|
|
1378
|
-
let e = h ? " AUTOINCREMENT" : "";
|
|
1379
|
-
t.push(` PRIMARY KEY (${f(p, u)}${e})` + (S ? "," : ""));
|
|
1380
|
-
}
|
|
1381
|
-
x.forEach(({ relationship: e, startTable: n, start: r, end: i }, a) => {
|
|
1382
|
-
let o = g(e, Er).map((e) => ` ${e}`).join(""), [, c] = _(n.name, s);
|
|
1383
|
-
t.push(` FOREIGN KEY (${f(i, u)}) REFERENCES ${u}${c}${u} (${f(r, u)})${o}` + (x.length - 1 > a ? "," : ""));
|
|
1384
|
-
}), t.push(");"), m !== null && !h && (t.push(""), t.push(`-- SQLite takes AUTOINCREMENT only on an INTEGER column, so ${u}${i.name}${u}.${u}${m.name}${u} is written without it.`));
|
|
1385
|
-
}
|
|
1386
|
-
function jr({ settings: { bracketType: e } }, { buffer: t, column: n, isComma: r, spaceSize: i, logicalNameAsComment: a }) {
|
|
1387
|
-
let o = K(e), s = [], c = b(n, a);
|
|
1388
|
-
c !== "" && t.push(` ${Dr(c)}`), s.push(` ${o}${n.name}${o}` + O(i.name - n.name.length)), s.push(`${n.dataType}` + O(i.dataType - n.dataType.length)), s.push(`${L(n.options, z.notNull) ? "NOT NULL" : "NULL "}`), L(n.options, z.unique) && s.push("UNIQUE"), !L(n.options, z.autoIncrement) && n.default.trim() !== "" && s.push(`DEFAULT ${E(n.default, F.SQLite)}`), t.push(s.join(" ") + `${r ? "," : ""}`);
|
|
1389
|
-
}
|
|
1390
|
-
function Mr({ settings: { bracketType: e }, collections: t }, { buffer: i, index: a, indexNames: o, statements: s }) {
|
|
1391
|
-
let c = K(e), l = n(t).collection("tableEntities").selectById(a.tableId);
|
|
1392
|
-
if (!l) return;
|
|
1393
|
-
let u = v(t, l, a).map(({ indexColumn: e, column: t }) => ({ name: `${c}${t.name}${c} ${P(e.orderType)}` }));
|
|
1394
|
-
if (u.length !== 0) {
|
|
1395
|
-
let [t, n] = _(l.name, e), d = a.name;
|
|
1396
|
-
if (a.name.trim() === "") {
|
|
1397
|
-
let t = N(l.name, e);
|
|
1398
|
-
d = R(o, `IDX_${t}`), o.push({
|
|
1399
|
-
id: x(),
|
|
1400
|
-
name: d
|
|
1401
|
-
});
|
|
1402
|
-
}
|
|
1403
|
-
let p = `${t === "" || d.includes(".") ? "" : `${t}.`}${c}${d}${c}`;
|
|
1404
|
-
i.push(`CREATE ${a.unique ? "UNIQUE " : ""}INDEX${r(s)} ${p}`), i.push(` ON ${c}${n}${c} (${f(u)});`);
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
function Nr() {
|
|
1408
|
-
return "";
|
|
1409
|
-
}
|
|
1410
|
-
function Pr({ settings: { bracketType: e } }, { tables: t }) {
|
|
1411
|
-
if (t.length === 0) return "";
|
|
1412
|
-
let n = K(e);
|
|
1413
|
-
return ["PRAGMA foreign_keys=OFF;", t.map(({ name: e }) => `DROP TABLE IF EXISTS ${n}${e}${n};`).join("\n")].join("\n\n");
|
|
1414
|
-
}
|
|
1415
|
-
//#endregion
|
|
1416
|
-
//#region src/utils/schema-sql/index.ts
|
|
1417
|
-
var Fr = {
|
|
1418
|
-
[F.Databricks]: {
|
|
1419
|
-
createSchema: $t,
|
|
1420
|
-
formatHeader: on,
|
|
1421
|
-
formatDropBlock: sn
|
|
1422
|
-
},
|
|
1423
|
-
[F.MariaDB]: {
|
|
1424
|
-
createSchema: Tn,
|
|
1425
|
-
formatHeader: Sn,
|
|
1426
|
-
formatDropBlock: Cn
|
|
1427
|
-
},
|
|
1428
|
-
[F.MSSQL]: {
|
|
1429
|
-
createSchema: Nn,
|
|
1430
|
-
formatHeader: Gn,
|
|
1431
|
-
formatDropBlock: Kn
|
|
1432
|
-
},
|
|
1433
|
-
[F.MySQL]: {
|
|
1434
|
-
createSchema: dn,
|
|
1435
|
-
formatHeader: Sn,
|
|
1436
|
-
formatDropBlock: Cn
|
|
1437
|
-
},
|
|
1438
|
-
[F.Oracle]: {
|
|
1439
|
-
createSchema: Jn,
|
|
1440
|
-
formatHeader: rr,
|
|
1441
|
-
formatDropBlock: ar
|
|
1442
|
-
},
|
|
1443
|
-
[F.PostgreSQL]: {
|
|
1444
|
-
createSchema: lr,
|
|
1445
|
-
formatHeader: hr,
|
|
1446
|
-
formatDropBlock: gr
|
|
1447
|
-
},
|
|
1448
|
-
[F.Snowflake]: {
|
|
1449
|
-
createSchema: vr,
|
|
1450
|
-
formatHeader: wr,
|
|
1451
|
-
formatDropBlock: Tr
|
|
1452
|
-
},
|
|
1453
|
-
[F.SQLite]: {
|
|
1454
|
-
createSchema: Or,
|
|
1455
|
-
formatHeader: Nr,
|
|
1456
|
-
formatDropBlock: Pr
|
|
1457
|
-
}
|
|
1458
|
-
};
|
|
1459
|
-
function Ir(e) {
|
|
1460
|
-
return e === "" ? "" : e.slice(1, -1);
|
|
1461
|
-
}
|
|
1462
|
-
function Lr(e, t, n, r) {
|
|
1463
|
-
let i = t || e.settings.database, a = Fr[i];
|
|
1464
|
-
if (!a) return "";
|
|
1465
|
-
let { databaseName: o } = e.settings, s = he(i, r, o), c = C(), l = Ir(a.createSchema(e, n, {
|
|
1466
|
-
statements: s.statements,
|
|
1467
|
-
written: c,
|
|
1468
|
-
logicalNameAsComment: r?.logicalNameAsComment === !0
|
|
1469
|
-
})), u = r?.scripts ?? n === void 0 ? e.settings.ddlScripts : void 0, d = Ae(u?.before ?? "", i), f = Ae(u?.after ?? "", i), p = s.headerName === "valid" ? s.header : B.none, m = s.statements === I.recreate ? a.formatDropBlock(e, c, p, o) : "";
|
|
1470
|
-
return !d && !m && !l && !f ? "" : `\n${[
|
|
1471
|
-
p === B.none ? "" : a.formatHeader(e, p, o),
|
|
1472
|
-
d,
|
|
1473
|
-
m,
|
|
1474
|
-
f ? l.replace(/\n+$/, "") : l,
|
|
1475
|
-
f
|
|
1476
|
-
].filter(Boolean).join("\n\n")}\n`;
|
|
1477
|
-
}
|
|
1478
|
-
function Rr(e, t) {
|
|
1479
|
-
return D(e, t).tables.map((e) => e.name);
|
|
1480
|
-
}
|
|
1481
|
-
function zr(e, t) {
|
|
1482
|
-
let { settings: r, doc: { indexIds: i }, collections: a } = e, o = [""], s = r.database, c = [], l = n(a).collection("indexEntities").selectByIds(i).filter((e) => e.tableId === t.id);
|
|
1483
|
-
switch (s) {
|
|
1484
|
-
case F.Databricks:
|
|
1485
|
-
en(e, {
|
|
1486
|
-
buffer: o,
|
|
1487
|
-
table: t
|
|
1488
|
-
}), o.push(""), tn(e, {
|
|
1489
|
-
buffer: o,
|
|
1490
|
-
table: t
|
|
1491
|
-
}), l.forEach((t) => {
|
|
1492
|
-
an(e, {
|
|
1493
|
-
index: t,
|
|
1494
|
-
buffer: o,
|
|
1495
|
-
indexNames: c
|
|
1496
|
-
}), o.push("");
|
|
1497
|
-
});
|
|
1498
|
-
break;
|
|
1499
|
-
case F.MariaDB:
|
|
1500
|
-
En(e, {
|
|
1501
|
-
buffer: o,
|
|
1502
|
-
table: t
|
|
1503
|
-
}), o.push(""), Dn(e, {
|
|
1504
|
-
buffer: o,
|
|
1505
|
-
table: t
|
|
1506
|
-
}), l.forEach((t) => {
|
|
1507
|
-
An(e, {
|
|
1508
|
-
index: t,
|
|
1509
|
-
buffer: o,
|
|
1510
|
-
indexNames: c
|
|
1511
|
-
}), o.push("");
|
|
1512
|
-
});
|
|
1513
|
-
break;
|
|
1514
|
-
case F.MSSQL:
|
|
1515
|
-
Pn(e, {
|
|
1516
|
-
buffer: o,
|
|
1517
|
-
table: t
|
|
1518
|
-
}), o.push(""), Fn(e, {
|
|
1519
|
-
buffer: o,
|
|
1520
|
-
table: t
|
|
1521
|
-
}), l.forEach((t) => {
|
|
1522
|
-
Wn(e, {
|
|
1523
|
-
index: t,
|
|
1524
|
-
buffer: o,
|
|
1525
|
-
indexNames: c
|
|
1526
|
-
}), o.push("");
|
|
1527
|
-
});
|
|
1528
|
-
break;
|
|
1529
|
-
case F.MySQL:
|
|
1530
|
-
pn(e, {
|
|
1531
|
-
buffer: o,
|
|
1532
|
-
table: t
|
|
1533
|
-
}), o.push(""), gn(e, {
|
|
1534
|
-
buffer: o,
|
|
1535
|
-
table: t
|
|
1536
|
-
}), l.forEach((t) => {
|
|
1537
|
-
xn(e, {
|
|
1538
|
-
index: t,
|
|
1539
|
-
buffer: o,
|
|
1540
|
-
indexNames: c
|
|
1541
|
-
}), o.push("");
|
|
1542
|
-
});
|
|
1543
|
-
break;
|
|
1544
|
-
case F.Oracle:
|
|
1545
|
-
Yn(e, {
|
|
1546
|
-
buffer: o,
|
|
1547
|
-
table: t
|
|
1548
|
-
}), o.push(""), Xn(e, {
|
|
1549
|
-
buffer: o,
|
|
1550
|
-
table: t
|
|
1551
|
-
}), l.forEach((t) => {
|
|
1552
|
-
tr(e, {
|
|
1553
|
-
index: t,
|
|
1554
|
-
buffer: o,
|
|
1555
|
-
indexNames: c
|
|
1556
|
-
}), o.push("");
|
|
1557
|
-
});
|
|
1558
|
-
break;
|
|
1559
|
-
case F.PostgreSQL:
|
|
1560
|
-
ur(e, {
|
|
1561
|
-
buffer: o,
|
|
1562
|
-
table: t
|
|
1563
|
-
}), o.push(""), l.forEach((t) => {
|
|
1564
|
-
mr(e, {
|
|
1565
|
-
index: t,
|
|
1566
|
-
buffer: o,
|
|
1567
|
-
indexNames: c
|
|
1568
|
-
}), o.push("");
|
|
1569
|
-
});
|
|
1570
|
-
break;
|
|
1571
|
-
case F.Snowflake:
|
|
1572
|
-
yr(e, {
|
|
1573
|
-
buffer: o,
|
|
1574
|
-
table: t
|
|
1575
|
-
}), o.push(""), l.forEach((t) => {
|
|
1576
|
-
Cr(e, {
|
|
1577
|
-
index: t,
|
|
1578
|
-
buffer: o,
|
|
1579
|
-
indexNames: c
|
|
1580
|
-
}), o.push("");
|
|
1581
|
-
});
|
|
1582
|
-
break;
|
|
1583
|
-
case F.SQLite: Ar(e, {
|
|
1584
|
-
buffer: o,
|
|
1585
|
-
table: t
|
|
1586
|
-
}), o.push(""), l.forEach((t) => {
|
|
1587
|
-
Mr(e, {
|
|
1588
|
-
index: t,
|
|
1589
|
-
buffer: o,
|
|
1590
|
-
indexNames: c
|
|
1591
|
-
}), o.push("");
|
|
1592
|
-
});
|
|
1593
|
-
}
|
|
1594
|
-
return o.join("\n");
|
|
1595
|
-
}
|
|
1596
|
-
//#endregion
|
|
1597
|
-
//#region src/engine/shared-store.ts
|
|
1598
|
-
var Br = 2, Vr = je(Ie);
|
|
1599
|
-
function Hr(e, t, n) {
|
|
1600
|
-
let r = n?.manualStreamFlush ?? !1, i = { editorId: e.state.editor.id }, o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), c = new J(), l = new J(), u = new J(), d = new J(), f = new J(), p = ye(r ? Xe(f) : Ze(f)), m = !0, h = !0;
|
|
1601
|
-
o.add(Be(new q((t) => e.subscribe((e) => t.next(e))), l).pipe(pe(fe), de([W.shared]), p, ke(u, d), p, ze((e) => a(W.shared, e.map((e) => {
|
|
1602
|
-
let n = {
|
|
1603
|
-
...e,
|
|
1604
|
-
meta: Object.assign({}, e.meta ?? {}, {
|
|
1605
|
-
...i,
|
|
1606
|
-
nickname: t?.getNickname?.()
|
|
1607
|
-
})
|
|
1608
|
-
};
|
|
1609
|
-
return Vr(e.type) ? ae(W.following, n) : n;
|
|
1610
|
-
})))).subscribe((e) => c.next(e)));
|
|
1611
|
-
let g = () => {
|
|
1612
|
-
l.next([{
|
|
1613
|
-
...be(),
|
|
1614
|
-
version: e.context.clock.getVersion()
|
|
1615
|
-
}]);
|
|
1616
|
-
};
|
|
1617
|
-
o.add(new q((t) => e.subscribe((e) => t.next(e))).pipe(Re((e) => !h && e.some(({ type: e }) => e === S.type))).subscribe(g));
|
|
1618
|
-
let _ = () => {
|
|
1619
|
-
let e = 0 < s.size;
|
|
1620
|
-
m && e ? u.next() : d.next();
|
|
1621
|
-
}, v = (t) => {
|
|
1622
|
-
let n = (Array.isArray(t) ? t : [t]).some((e) => e.type === be.type), r = e.state.lww;
|
|
1623
|
-
n && !Ke(r) && l.next([{
|
|
1624
|
-
...ie({ lww: r }),
|
|
1625
|
-
version: e.context.clock.getVersion()
|
|
1626
|
-
}]);
|
|
1627
|
-
};
|
|
1628
|
-
return Object.freeze({
|
|
1629
|
-
connection: () => {
|
|
1630
|
-
m = !0, _();
|
|
1631
|
-
},
|
|
1632
|
-
disconnect: () => {
|
|
1633
|
-
m = !1, _();
|
|
1634
|
-
},
|
|
1635
|
-
dispatch: (t) => {
|
|
1636
|
-
e.dispatch(t), v(t);
|
|
1637
|
-
},
|
|
1638
|
-
dispatchSync: (t) => {
|
|
1639
|
-
e.dispatchSync(t), v(t);
|
|
1640
|
-
},
|
|
1641
|
-
subscribe: (e) => {
|
|
1642
|
-
let t = c.subscribe((t) => e(t));
|
|
1643
|
-
return s.add(t), _(), h &&= (g(), !1), () => {
|
|
1644
|
-
t.unsubscribe(), s.delete(t), _();
|
|
1645
|
-
};
|
|
1646
|
-
},
|
|
1647
|
-
flushStreamBuffers: () => {
|
|
1648
|
-
for (let e = 0; e < Br; e++) f.next();
|
|
1649
|
-
},
|
|
1650
|
-
destroy: () => {
|
|
1651
|
-
Array.from(o).forEach((e) => e.unsubscribe()), Array.from(s).forEach((e) => e.unsubscribe()), o.clear(), s.clear(), c.complete(), u.complete(), d.complete(), f.complete();
|
|
1652
|
-
}
|
|
1653
|
-
});
|
|
1654
|
-
}
|
|
1655
|
-
//#endregion
|
|
1656
|
-
export { ct as C, at as S, Et as _, kr as a, Dt as b, Vt as c, Gt as d, Kt as f, Tt as g, lt as h, Rr as i, Ut as l, X as m, Lr as n, nr as o, qt as p, zr as r, Wt as s, Hr as t, Ht as u, wt as v, Ye as w, zt as x, Bt as y };
|