@marimo-team/frontend 0.16.1 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-2wVcyvDj.js → ConnectedDataExplorerComponent-Brtw1DxF.js} +1 -1
- package/dist/assets/{ImageComparisonComponent-D2j6i0hv.js → ImageComparisonComponent-Dxl-PbZX.js} +1 -1
- package/dist/assets/{VegaLite-BckFaf2D.js → VegaLite-BXQF0Cx_.js} +1 -1
- package/dist/assets/_baseEach-BjSm9ht3.js +1 -0
- package/dist/assets/_baseMap-CV4Ezmtf.js +1 -0
- package/dist/assets/_baseUniq-Ci9yZGxz.js +1 -0
- package/dist/assets/{_createAggregator-C5CVY-0t.js → _createAggregator-VFK9K2d9.js} +1 -1
- package/dist/assets/{agent-panel-RGLNjkYe.js → agent-panel-BoscVLCT.js} +7 -7
- package/dist/assets/{any-language-editor-DjuXwGCA.js → any-language-editor-ChaY_VUU.js} +1 -1
- package/dist/assets/{architectureDiagram-W76B3OCA-Dyj4ds_R.js → architectureDiagram-W76B3OCA-CueUUFYd.js} +1 -1
- package/dist/assets/{between-horizontal-start-Dt2aKpPf.js → between-horizontal-start-DAHqmLYT.js} +1 -1
- package/dist/assets/{blockDiagram-QIGZ2CNN-o-i7DDvN.js → blockDiagram-QIGZ2CNN-BYYygyWn.js} +1 -1
- package/dist/assets/{c4Diagram-FPNF74CW-DGHEwWrx.js → c4Diagram-FPNF74CW-DAz3xEh1.js} +1 -1
- package/dist/assets/channel-6SqQ2U_X.js +1 -0
- package/dist/assets/chat-panel-DJkOLrw9.js +3 -0
- package/dist/assets/{chunk-4BX2VUAB-BJecb-Ri.js → chunk-4BX2VUAB-8g-RyHdt.js} +1 -1
- package/dist/assets/{chunk-55IACEB6-CAATkc4w.js → chunk-55IACEB6-iWZZ8Mt6.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-DPuNbQ-f.js → chunk-FMBD7UC4-knjss4wk.js} +1 -1
- package/dist/assets/{chunk-K7UQS3LO-C8TWVLiH.js → chunk-K7UQS3LO-DVIwPBgZ.js} +1 -1
- package/dist/assets/{chunk-QN33PNHL-DiZZ09q4.js → chunk-QN33PNHL-CBU8pN6I.js} +1 -1
- package/dist/assets/{chunk-QZHKN3VN-BIUM7usu.js → chunk-QZHKN3VN-5ljElUF4.js} +1 -1
- package/dist/assets/{chunk-TVAH2DTR-vGTArPBG.js → chunk-TVAH2DTR-DkIdGINc.js} +1 -1
- package/dist/assets/{chunk-TZMSLE5B-D2KRqp_x.js → chunk-TZMSLE5B-CIFOSTqh.js} +1 -1
- package/dist/assets/{circle-play-cjeNez0N.js → circle-play-BOdsbq5u.js} +1 -1
- package/dist/assets/classDiagram-KNZD7YFC-DVqXcTYf.js +1 -0
- package/dist/assets/classDiagram-v2-RKCZMP56-DVqXcTYf.js +1 -0
- package/dist/assets/{clear-button-C97JtAez.js → clear-button-GAjXl0CQ.js} +1 -1
- package/dist/assets/clone-DSDb0xen.js +1 -0
- package/dist/assets/command-palette-BUXkqoLh.js +1 -0
- package/dist/assets/{common-Du9rSOwD.js → common-DahoYqdi.js} +1 -1
- package/dist/assets/{compile-CZXqyOxa.js → compile-Bg8uJ7vm.js} +1 -1
- package/dist/assets/{cose-bilkent-S5V4N54A-CqUN5Y9b.js → cose-bilkent-S5V4N54A-z_0gqD9K.js} +1 -1
- package/dist/assets/{dagre-5GWH7T2D-RJqTI9DM.js → dagre-5GWH7T2D-BMt7CNXL.js} +1 -1
- package/dist/assets/{data-grid-overlay-editor-DZN0q1LV.js → data-grid-overlay-editor-Ctn4XtXx.js} +1 -1
- package/dist/assets/datasources-panel-C7sqRIHs.js +1 -0
- package/dist/assets/{dependency-graph-panel-CEog_O7V.js → dependency-graph-panel-DNajptzv.js} +4 -4
- package/dist/assets/{diagram-N5W7TBWH-D-l4zZ9d.js → diagram-N5W7TBWH-BzwvLvAy.js} +1 -1
- package/dist/assets/{diagram-QEK2KX5R-CCOmBUt-.js → diagram-QEK2KX5R-DRLJ56FS.js} +1 -1
- package/dist/assets/{diagram-S2PKOQOG-C_I_9jnZ.js → diagram-S2PKOQOG-Bf8x4KTU.js} +1 -1
- package/dist/assets/{documentation-panel-C1BtMZ3M.js → documentation-panel-Dm6Ozl67.js} +1 -1
- package/dist/assets/{edit-page-B-oevUZ9.js → edit-page-CGc9EjuG.js} +53 -42
- package/dist/assets/{ellipsis-vertical-BEb-J8z6.js → ellipsis-vertical-Bj1YXvZe.js} +1 -1
- package/dist/assets/{empty-state-C99UyDE3.js → empty-state-CYev-D31.js} +1 -1
- package/dist/assets/{erDiagram-AWTI2OKA-BePOLi5M.js → erDiagram-AWTI2OKA-DmgzgN_I.js} +1 -1
- package/dist/assets/{error-panel-Bs34jXFh.js → error-panel-BYG4twCa.js} +1 -1
- package/dist/assets/{file-explorer-panel-Ck6UL861.js → file-explorer-panel-BSMiOApi.js} +1 -1
- package/dist/assets/{flowDiagram-PVAE7QVJ-BgjFu5l7.js → flowDiagram-PVAE7QVJ-BdRKkajr.js} +1 -1
- package/dist/assets/{ganttDiagram-OWAHRB6G-YOPb3XSV.js → ganttDiagram-OWAHRB6G-lfRAMnq_.js} +5 -5
- package/dist/assets/{gitGraphDiagram-NY62KEGX-CGhqaDTy.js → gitGraphDiagram-NY62KEGX-CQVTIrHF.js} +1 -1
- package/dist/assets/{glide-data-editor-9QUH6iso.js → glide-data-editor-D5A4pou7.js} +4 -4
- package/dist/assets/{graph-DQQFGrho.js → graph-CBNo279v.js} +1 -1
- package/dist/assets/{home-page-DRKpPCrF.js → home-page-CmdznBJR.js} +2 -2
- package/dist/assets/{index-SGLNXrGP.js → index-0dfGh-Gj.js} +1 -1
- package/dist/assets/{index-aE43R74q.js → index-BDYVSSzB.js} +1 -1
- package/dist/assets/{index-BJNCMUmG.js → index-B_KyDZ94.js} +1 -1
- package/dist/assets/{index-BjgnbONl.js → index-Bfy-I_lW.js} +1 -1
- package/dist/assets/{index-CUFv_thQ.js → index-Bh98Tp-z.js} +1 -1
- package/dist/assets/{index-C2MD0vgD.js → index-BhroIwBL.js} +1 -1
- package/dist/assets/{index-DdnKZNxM.js → index-BtQtesaI.js} +1 -1
- package/dist/assets/index-C0iXCvyY.css +1 -0
- package/dist/assets/index-C1SHFMCp.js +581 -0
- package/dist/assets/{index-C_tkBKNO.js → index-C6DWtSls.js} +1 -1
- package/dist/assets/{index-Aeo6WiK7.js → index-C71cdkH-.js} +1 -1
- package/dist/assets/{index-G5QZppK2.js → index-CT_FTqvK.js} +1 -1
- package/dist/assets/{index-B8jXZ12t.js → index-CU5rRr66.js} +1 -1
- package/dist/assets/{index-BAbIIxHU.js → index-Cb6duXQm.js} +1 -1
- package/dist/assets/{index-BW3k9Gss.js → index-D23e9zQj.js} +1 -1
- package/dist/assets/index-DUGecC2Z.js +68 -0
- package/dist/assets/{index-CFKO7WXI.js → index-DcGIOAQi.js} +1 -1
- package/dist/assets/{index-ClzeQrN7.js → index-PJfa9qXY.js} +1 -1
- package/dist/assets/{index-C1ez98sk.js → index-SPslPC2B.js} +1 -1
- package/dist/assets/{index-BprjMYH5.js → index-VPQlo4Uz.js} +1 -1
- package/dist/assets/{index-CfaDbEdi.js → index-qbTLKWyG.js} +1 -1
- package/dist/assets/infoDiagram-STP46IZ2-DBu8p9gd.js +2 -0
- package/dist/assets/{isEmpty-D-4c7sMv.js → isEmpty-CnOLuQIv.js} +1 -1
- package/dist/assets/{journeyDiagram-BIP6EPQ6-C94u3Mv3.js → journeyDiagram-BIP6EPQ6-6U_vHJBH.js} +1 -1
- package/dist/assets/{kanban-definition-6OIFK2YF-BEXYFzz7.js → kanban-definition-6OIFK2YF-DgnR14ys.js} +1 -1
- package/dist/assets/{layout-Bz2BJ2ru.js → layout-RHmq4fP9.js} +1 -1
- package/dist/assets/{linear-D8s7K76e.js → linear-CLdOVPGV.js} +1 -1
- package/dist/assets/links-Dd1icsEk.js +7 -0
- package/dist/assets/{logs-panel-DC7wpmPz.js → logs-panel-CjbuhBLx.js} +1 -1
- package/dist/assets/{markdown-renderer-DRdSWR9X.js → markdown-renderer-X5YJvAZq.js} +3 -3
- package/dist/assets/{mermaid-Y3x4hmD0.js → mermaid-Bl2T5oEC.js} +1 -1
- package/dist/assets/{mermaid.core-DzthE35Y.js → mermaid.core-CfukBvGI.js} +4 -4
- package/dist/assets/min-BXIes1Za.js +1 -0
- package/dist/assets/{mindmap-definition-Q6HEUPPD-DktvuLe1.js → mindmap-definition-Q6HEUPPD-BXCjP4Lu.js} +1 -1
- package/dist/assets/{number-overlay-editor-BEfwI1IT.js → number-overlay-editor-BUyqkSes.js} +1 -1
- package/dist/assets/{outline-panel-CdsnAy2w.js → outline-panel-BvGcPKdd.js} +1 -1
- package/dist/assets/{packages-panel-DiTA-d_D.js → packages-panel-BichDQWG.js} +1 -1
- package/dist/assets/{pieDiagram-ADFJNKIX-DQDNQ-de.js → pieDiagram-ADFJNKIX-CMzJFIJM.js} +1 -1
- package/dist/assets/{quadrantDiagram-LMRXKWRM-0kgIXc2-.js → quadrantDiagram-LMRXKWRM-CfGssUlO.js} +1 -1
- package/dist/assets/{react-plotly-DJqqfM7c.js → react-plotly-DR3hV0HW.js} +1 -1
- package/dist/assets/{requirementDiagram-4UW4RH46-B5rb0ypd.js → requirementDiagram-4UW4RH46-CfrFolth.js} +1 -1
- package/dist/assets/{run-page-CFmLrv1R.js → run-page-Bqd_4ePD.js} +1 -1
- package/dist/assets/{sankeyDiagram-GR3RE2ED-Dom7IlnF.js → sankeyDiagram-GR3RE2ED-D_UttKU0.js} +1 -1
- package/dist/assets/{scratchpad-panel-CuHWpHO8.js → scratchpad-panel-D5N15ji1.js} +1 -1
- package/dist/assets/secrets-panel-BpbnAO4R.js +1 -0
- package/dist/assets/{sequenceDiagram-C3RYC4MD-PNJWXQbw.js → sequenceDiagram-C3RYC4MD-MdfQQApP.js} +1 -1
- package/dist/assets/{slides-component-CJgaTRZ0.js → slides-component-C0z7rXmk.js} +1 -1
- package/dist/assets/{snippets-panel-B2EC1txM.js → snippets-panel-wlpZ_Wzx.js} +1 -1
- package/dist/assets/sortBy-BW_zNHP6.js +1 -0
- package/dist/assets/{state-CWict9RU.js → state-CDooX-dk.js} +1 -1
- package/dist/assets/{stateDiagram-KXAO66HF-BE58aJnr.js → stateDiagram-KXAO66HF-H7kfw3ot.js} +1 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-YMeb9qMR.js +1 -0
- package/dist/assets/{storage-DRaR04wR.js → storage-b1QCapTq.js} +6 -6
- package/dist/assets/{terminal-BX3Su5q7.js → terminal-CPV44BXz.js} +1 -1
- package/dist/assets/{time-hUzZfpNE.js → time-DDy3xv5Y.js} +1 -1
- package/dist/assets/{timeline-definition-XQNQX7LJ-CqQP9t51.js → timeline-definition-XQNQX7LJ-J-cPRT2_.js} +1 -1
- package/dist/assets/{tracing-B10Q1n-L.js → tracing-3eHHRUiJ.js} +2 -2
- package/dist/assets/{tracing-panel-Du8WCnno.js → tracing-panel-BMgy3D7d.js} +2 -2
- package/dist/assets/{trash-B81GTiv6.js → trash--tonOuDe.js} +1 -1
- package/dist/assets/{tree-6vW2ogkh.js → tree-ouIGEsVg.js} +1 -1
- package/dist/assets/{treemap-75Q7IDZK-CdwDwwsz.js → treemap-75Q7IDZK-CzJTJ_3R.js} +20 -20
- package/dist/assets/{variable-panel-D5qgJI7k.js → variable-panel-sFTn4Oih.js} +1 -1
- package/dist/assets/{vega-component-DJaJWMJM.js → vega-component-BkPkzX9r.js} +1 -1
- package/dist/assets/{xychartDiagram-6GGTOJPD-WFtXqaM9.js → xychartDiagram-6GGTOJPD-BZ8WOb_8.js} +1 -1
- package/dist/index.html +10 -3
- package/package.json +8 -8
- package/src/__mocks__/common.ts +5 -3
- package/src/__mocks__/notebook.ts +2 -2
- package/src/__mocks__/requests.ts +1 -0
- package/src/__tests__/main.test.tsx +2 -2
- package/src/components/ai/ai-provider-icon.tsx +2 -0
- package/src/components/app-config/ai-config.tsx +32 -1
- package/src/components/app-config/common.tsx +2 -2
- package/src/components/app-config/user-config-form.tsx +26 -0
- package/src/components/audio/audio-recorder.tsx +0 -1
- package/src/components/chat/acp/blocks.tsx +2 -2
- package/src/components/chat/acp/thread.tsx +3 -5
- package/src/components/chat/acp/utils.ts +5 -5
- package/src/components/chat/chat-panel.tsx +1 -1
- package/src/components/data-table/__tests__/columns.test.tsx +38 -0
- package/src/components/data-table/__tests__/data-table.test.tsx +2 -2
- package/src/components/data-table/cell-hover-template/feature.ts +1 -1
- package/src/components/data-table/cell-hover-template/types.ts +1 -1
- package/src/components/data-table/charts/__tests__/altair-generator.test.ts +1 -1
- package/src/components/data-table/charts/chart-spec/tooltips.ts +3 -3
- package/src/components/data-table/charts/components/chart-items.tsx +1 -1
- package/src/components/data-table/charts/components/form-fields.tsx +2 -2
- package/src/components/data-table/charts/constants.ts +1 -1
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
- package/src/components/data-table/column-summary/chart-spec-model.tsx +2 -2
- package/src/components/data-table/columns.tsx +22 -3
- package/src/components/data-table/data-table.tsx +35 -3
- package/src/components/data-table/date-popover.tsx +1 -1
- package/src/components/data-table/download-actions.tsx +1 -1
- package/src/components/data-table/range-focus/__tests__/utils.test.ts +5 -5
- package/src/components/data-table/renderers.tsx +22 -13
- package/src/components/data-table/row-viewer-panel/row-viewer.tsx +1 -1
- package/src/components/data-table/schemas.ts +16 -0
- package/src/components/data-table/types.ts +4 -3
- package/src/components/datasources/column-preview.tsx +9 -6
- package/src/components/debugger/debugger-code.tsx +1 -1
- package/src/components/dependency-graph/custom-node.tsx +15 -6
- package/src/components/dependency-graph/dependency-graph-minimap.tsx +2 -2
- package/src/components/dependency-graph/dependency-graph-tree.tsx +2 -2
- package/src/components/dependency-graph/dependency-graph.tsx +1 -1
- package/src/components/dependency-graph/elements.ts +7 -7
- package/src/components/dependency-graph/utils/changes.ts +4 -4
- package/src/components/editor/Cell.tsx +7 -1
- package/src/components/editor/ai/transport/chat-transport.tsx +1 -1
- package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +1 -1
- package/src/components/editor/chrome/panels/packages-panel.tsx +1 -1
- package/src/components/editor/columns/storage.ts +1 -1
- package/src/components/editor/database/__tests__/__snapshots__/as-code.test.ts.snap +36 -0
- package/src/components/editor/database/__tests__/as-code.test.ts +30 -7
- package/src/components/editor/database/add-database-form.tsx +11 -0
- package/src/components/editor/database/as-code.ts +104 -5
- package/src/components/editor/database/schemas.ts +36 -18
- package/src/components/editor/errors/auto-fix.tsx +12 -2
- package/src/components/editor/errors/sql-validation-errors.tsx +40 -0
- package/src/components/editor/navigation/clipboard.ts +2 -2
- package/src/components/editor/output/ConsoleOutput.tsx +14 -2
- package/src/components/editor/output/JsonOutput.tsx +1 -1
- package/src/components/editor/output/MarimoErrorOutput.tsx +60 -1
- package/src/components/editor/output/MarimoTracebackOutput.tsx +17 -2
- package/src/components/editor/renderers/grid-layout/types.ts +2 -2
- package/src/components/editor/renderers/plugins.ts +1 -1
- package/src/components/editor/renderers/types.ts +1 -1
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +7 -7
- package/src/components/forms/form.tsx +5 -5
- package/src/components/ui/links.tsx +1 -0
- package/src/core/ai/__tests__/model-registry.test.ts +0 -10
- package/src/core/ai/context/providers/cell-output.ts +1 -18
- package/src/core/ai/context/providers/error.ts +2 -2
- package/src/core/ai/ids/ids.ts +1 -0
- package/src/core/ai/model-registry.ts +2 -1
- package/src/core/cells/cells.ts +5 -5
- package/src/core/cells/logs.ts +1 -1
- package/src/core/cells/types.ts +1 -1
- package/src/core/codemirror/__tests__/format.test.ts +6 -0
- package/src/core/codemirror/cells/traceback-decorations.ts +1 -1
- package/src/core/codemirror/editing/commands.ts +2 -2
- package/src/core/codemirror/find-replace/navigate.ts +1 -1
- package/src/core/codemirror/language/__tests__/extension.test.ts +24 -0
- package/src/core/codemirror/language/__tests__/sql-validation.test.ts +133 -0
- package/src/core/codemirror/language/__tests__/sql.test.ts +764 -79
- package/src/core/codemirror/language/languages/markdown.ts +4 -1
- package/src/core/codemirror/language/languages/sql/banner-validation-errors.ts +85 -0
- package/src/core/codemirror/language/languages/sql/completion-builder.ts +160 -0
- package/src/core/codemirror/language/languages/sql/completion-sources.tsx +9 -3
- package/src/core/codemirror/language/languages/sql/completion-store.ts +46 -50
- package/src/core/codemirror/language/languages/sql/renderers.tsx +485 -0
- package/src/core/codemirror/language/languages/sql/sql-mode.ts +20 -0
- package/src/core/codemirror/language/languages/sql/sql.ts +218 -4
- package/src/core/codemirror/language/languages/sql/utils.ts +4 -1
- package/src/core/codemirror/language/panel/panel.tsx +8 -2
- package/src/core/codemirror/language/panel/sql.tsx +86 -4
- package/src/core/codemirror/language/utils/ast.ts +3 -3
- package/src/core/codemirror/lsp/federated-lsp.ts +4 -4
- package/src/core/codemirror/lsp/lens.ts +4 -4
- package/src/core/codemirror/lsp/notebook-lsp.ts +1 -1
- package/src/core/codemirror/lsp/types.ts +1 -1
- package/src/core/codemirror/markdown/completions.ts +1 -1
- package/src/core/codemirror/reactive-references/analyzer.ts +2 -2
- package/src/core/codemirror/rtc/loro/awareness.ts +1 -1
- package/src/core/config/config-schema.ts +1 -0
- package/src/core/config/feature-flag.tsx +6 -2
- package/src/core/datasets/request-registry.ts +24 -1
- package/src/core/dom/events.ts +1 -1
- package/src/core/dom/outline.ts +2 -2
- package/src/core/dom/uiregistry.ts +2 -8
- package/src/core/errors/__tests__/errors.test.ts +22 -4
- package/src/core/errors/errors.ts +29 -1
- package/src/core/errors/state.ts +1 -1
- package/src/core/islands/bridge.ts +1 -0
- package/src/core/islands/main.ts +3 -2
- package/src/core/islands/parse.ts +1 -3
- package/src/core/kernel/messages.ts +2 -1
- package/src/core/network/CachingRequestRegistry.ts +74 -0
- package/src/core/network/DeferredRequestRegistry.ts +3 -1
- package/src/core/network/__tests__/CachingRequestRegistry.test.ts +73 -0
- package/src/core/network/requests-network.ts +7 -0
- package/src/core/network/requests-static.ts +1 -0
- package/src/core/network/requests-toasting.ts +1 -0
- package/src/core/network/types.ts +3 -1
- package/src/core/variables/state.ts +2 -2
- package/src/core/wasm/__tests__/state.test.ts +1 -1
- package/src/core/wasm/bridge.ts +5 -0
- package/src/core/websocket/useMarimoWebSocket.tsx +9 -2
- package/src/custom.d.ts +1 -1
- package/src/hooks/useCellRenderCount.ts +1 -0
- package/src/hooks/useResizeHandle.ts +4 -1
- package/src/plugins/core/RenderHTML.tsx +1 -2
- package/src/plugins/core/registerReactComponent.tsx +23 -19
- package/src/plugins/impl/DataTablePlugin.tsx +18 -6
- package/src/plugins/impl/FileUploadPlugin.tsx +1 -1
- package/src/plugins/impl/RefreshPlugin.tsx +1 -1
- package/src/plugins/impl/SliderPlugin.tsx +4 -0
- package/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx +27 -9
- package/src/plugins/impl/anywidget/__tests__/AnyWidgetPlugin.test.tsx +58 -2
- package/src/plugins/impl/anywidget/__tests__/model.test.ts +3 -4
- package/src/plugins/impl/anywidget/model.ts +2 -3
- package/src/plugins/impl/data-editor/types.ts +1 -1
- package/src/plugins/impl/data-explorer/components/query-form.tsx +1 -1
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +17 -5
- package/src/plugins/impl/data-frames/types.ts +1 -1
- package/src/plugins/impl/panel/PanelPlugin.tsx +2 -2
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +3 -3
- package/src/plugins/impl/vega/__tests__/loader.test.ts +2 -2
- package/src/plugins/impl/vega/loader.ts +1 -1
- package/src/plugins/impl/vega/vega-component.tsx +1 -1
- package/src/plugins/impl/vega/vega-loader.ts +2 -2
- package/src/plugins/layout/NavigationMenuPlugin.tsx +1 -1
- package/src/plugins/layout/RoutesPlugin.tsx +1 -2
- package/src/plugins/plugins.ts +2 -2
- package/src/stories/dataframe.stories.tsx +2 -0
- package/src/utils/Logger.ts +1 -1
- package/src/utils/__tests__/data-views.test.ts +30 -68
- package/src/utils/__tests__/dom.test.ts +167 -0
- package/src/utils/__tests__/id-tree.test.ts +49 -1
- package/src/utils/__tests__/storage.test.ts +1 -1
- package/src/utils/__tests__/traceback.test.ts +13 -2
- package/src/utils/arrays.ts +1 -1
- package/src/utils/createReducer.ts +1 -5
- package/src/utils/data-views.ts +6 -19
- package/src/utils/dom.ts +55 -0
- package/src/utils/edit-distance.ts +1 -1
- package/src/utils/fileToBase64.ts +1 -1
- package/src/utils/id-tree.tsx +20 -18
- package/src/utils/json/base64.ts +13 -0
- package/src/utils/json/json-parser.ts +2 -2
- package/src/utils/lru.ts +4 -0
- package/src/utils/mergeRefs.ts +1 -1
- package/src/utils/objects.ts +3 -3
- package/src/utils/pluralize.ts +1 -1
- package/src/utils/routes.ts +2 -2
- package/src/utils/sets.ts +1 -1
- package/src/utils/traceback.ts +45 -15
- package/src/utils/tracer.ts +11 -9
- package/dist/assets/_baseEach-CvTX9w0Y.js +0 -1
- package/dist/assets/_baseMap-CtlwA90f.js +0 -1
- package/dist/assets/_baseUniq-BKktIGQ1.js +0 -1
- package/dist/assets/channel-Co6iMgWq.js +0 -1
- package/dist/assets/chat-panel-9alr8FS4.js +0 -3
- package/dist/assets/classDiagram-KNZD7YFC-BbJ0rY3y.js +0 -1
- package/dist/assets/classDiagram-v2-RKCZMP56-BbJ0rY3y.js +0 -1
- package/dist/assets/clone-BMP0PsTa.js +0 -1
- package/dist/assets/command-palette-B93Pjcky.js +0 -1
- package/dist/assets/datasources-panel-v7H3cR0p.js +0 -1
- package/dist/assets/index-2252nrk6.js +0 -68
- package/dist/assets/index-C7CoaNFb.js +0 -578
- package/dist/assets/index-DadI618h.css +0 -1
- package/dist/assets/infoDiagram-STP46IZ2-CJLOpSAf.js +0 -2
- package/dist/assets/links-BpXlz1GG.js +0 -7
- package/dist/assets/min-BBO3-1Hg.js +0 -1
- package/dist/assets/secrets-panel-CfHc5YD0.js +0 -1
- package/dist/assets/sortBy-DZnlX29-.js +0 -1
- package/dist/assets/stateDiagram-v2-UMBNRL4Z-CdThjimL.js +0 -1
- package/src/__tests__/lru.test.ts +0 -74
|
@@ -103,6 +103,9 @@ export class MarkdownLanguageAdapter
|
|
|
103
103
|
code: string,
|
|
104
104
|
metadata: MarkdownLanguageAdapterMetadata,
|
|
105
105
|
): [string, number] {
|
|
106
|
+
// NB. Must be kept consistent with marimo/_convert/utils.py
|
|
107
|
+
// ::markdown_to_marimo
|
|
108
|
+
|
|
106
109
|
// Empty string
|
|
107
110
|
if (code === "") {
|
|
108
111
|
// Need at least a space, otherwise the output will be 6 quotes
|
|
@@ -152,7 +155,7 @@ export class MarkdownLanguageAdapter
|
|
|
152
155
|
const tree = pythonLanguage.parser.parse(pythonCode);
|
|
153
156
|
|
|
154
157
|
// This is the exact match of mo.md() signature
|
|
155
|
-
const enterOrder:
|
|
158
|
+
const enterOrder: { match: string | RegExp; stop?: boolean }[] = [
|
|
156
159
|
{ match: "Script" },
|
|
157
160
|
{ match: "ExpressionStatement" },
|
|
158
161
|
{ match: "CallExpression" },
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import type { SupportedDialects } from "@marimo-team/codemirror-sql";
|
|
4
|
+
import { atom, useAtomValue } from "jotai";
|
|
5
|
+
import type { CellId } from "@/core/cells/ids";
|
|
6
|
+
import { store } from "@/core/state/jotai";
|
|
7
|
+
|
|
8
|
+
export interface SQLValidationError {
|
|
9
|
+
errorType: string;
|
|
10
|
+
errorMessage: string;
|
|
11
|
+
codeblock?: string; // Code block that caused the error
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type CellToSQLErrors = Map<CellId, SQLValidationError>;
|
|
15
|
+
|
|
16
|
+
export const sqlValidationErrorsAtom = atom<CellToSQLErrors>(
|
|
17
|
+
new Map<CellId, SQLValidationError>(),
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const useSqlValidationErrorsForCell = (cellId: CellId) => {
|
|
21
|
+
const sqlValidationErrors = useAtomValue(sqlValidationErrorsAtom);
|
|
22
|
+
return sqlValidationErrors.get(cellId);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export function clearSqlValidationError(cellId: CellId) {
|
|
26
|
+
const sqlValidationErrors = store.get(sqlValidationErrorsAtom);
|
|
27
|
+
const newErrors = new Map(sqlValidationErrors);
|
|
28
|
+
newErrors.delete(cellId);
|
|
29
|
+
store.set(sqlValidationErrorsAtom, newErrors);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function clearAllSqlValidationErrors() {
|
|
33
|
+
store.set(sqlValidationErrorsAtom, new Map<CellId, SQLValidationError>());
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function setSqlValidationError({
|
|
37
|
+
cellId,
|
|
38
|
+
errorMessage,
|
|
39
|
+
dialect,
|
|
40
|
+
}: {
|
|
41
|
+
cellId: CellId;
|
|
42
|
+
errorMessage: string;
|
|
43
|
+
dialect: SupportedDialects | null;
|
|
44
|
+
}) {
|
|
45
|
+
const sqlValidationErrors = store.get(sqlValidationErrorsAtom);
|
|
46
|
+
const newErrors = new Map(sqlValidationErrors);
|
|
47
|
+
|
|
48
|
+
const errorResult: SQLValidationError =
|
|
49
|
+
dialect === "DuckDB"
|
|
50
|
+
? handleDuckdbError(errorMessage)
|
|
51
|
+
: splitErrorMessage(errorMessage);
|
|
52
|
+
|
|
53
|
+
newErrors.set(cellId, errorResult);
|
|
54
|
+
store.set(sqlValidationErrorsAtom, newErrors);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function handleDuckdbError(error: string): SQLValidationError {
|
|
58
|
+
const { errorType, errorMessage } = splitErrorMessage(error);
|
|
59
|
+
let newErrorMessage = errorMessage;
|
|
60
|
+
|
|
61
|
+
// Extract the LINE and the rest of the message as codeblock, keep errorMessage as whatever is before
|
|
62
|
+
let codeblock: string | undefined;
|
|
63
|
+
const lineIndex = errorMessage.indexOf("LINE ");
|
|
64
|
+
if (lineIndex !== -1) {
|
|
65
|
+
codeblock = errorMessage.slice(Math.max(0, lineIndex)).trim();
|
|
66
|
+
newErrorMessage = errorMessage.slice(0, Math.max(0, lineIndex)).trim();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
errorType,
|
|
71
|
+
errorMessage: newErrorMessage,
|
|
72
|
+
codeblock,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function splitErrorMessage(error: string) {
|
|
77
|
+
const errorType = error.split(":")[0].trim();
|
|
78
|
+
const errorMessage = error.split(":").slice(1).join(":").trim();
|
|
79
|
+
return { errorType, errorMessage };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export const exportedForTesting = {
|
|
83
|
+
splitErrorMessage,
|
|
84
|
+
handleDuckdbError,
|
|
85
|
+
};
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import type { Completion } from "@codemirror/autocomplete";
|
|
4
|
+
import type { SQLNamespace } from "@codemirror/lang-sql";
|
|
5
|
+
import { createRoot } from "react-dom/client";
|
|
6
|
+
import type {
|
|
7
|
+
Database,
|
|
8
|
+
DatabaseSchema,
|
|
9
|
+
DataTable,
|
|
10
|
+
DataTableColumn,
|
|
11
|
+
} from "@/core/kernel/messages";
|
|
12
|
+
import {
|
|
13
|
+
renderColumnInfo,
|
|
14
|
+
renderDatabaseInfo,
|
|
15
|
+
renderSchemaInfo,
|
|
16
|
+
renderTableInfo,
|
|
17
|
+
} from "./renderers";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Simple builder for SQL completion schemas.
|
|
21
|
+
*/
|
|
22
|
+
export class CompletionBuilder {
|
|
23
|
+
private schema: Record<string, SQLNamespace> = {};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Add a table with its columns at the specified path
|
|
27
|
+
*/
|
|
28
|
+
addTable(path: string[], table: DataTable): this {
|
|
29
|
+
const tableNamespace: SQLNamespace = {
|
|
30
|
+
self: tableToCompletion({
|
|
31
|
+
table: table,
|
|
32
|
+
}),
|
|
33
|
+
children: table.columns.map((col) =>
|
|
34
|
+
columnToCompletion({
|
|
35
|
+
column: col,
|
|
36
|
+
}),
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
this.setAt([...path, table.name], tableNamespace);
|
|
41
|
+
return this;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Add a schema at the specified path
|
|
46
|
+
*/
|
|
47
|
+
addSchema(path: string[], schema: DatabaseSchema): this {
|
|
48
|
+
const schemaObject: SQLNamespace = {
|
|
49
|
+
self: schemaToCompletion({
|
|
50
|
+
namespace: schema,
|
|
51
|
+
path: path,
|
|
52
|
+
}),
|
|
53
|
+
children: {},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
this.setAt(path, schemaObject);
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Add a database at the specified path
|
|
62
|
+
*/
|
|
63
|
+
addDatabase(path: string[], database: Database): this {
|
|
64
|
+
const databaseObject: SQLNamespace = {
|
|
65
|
+
self: databaseToCompletion({
|
|
66
|
+
namespace: database,
|
|
67
|
+
path: path,
|
|
68
|
+
}),
|
|
69
|
+
children: {},
|
|
70
|
+
};
|
|
71
|
+
this.setAt(path, databaseObject);
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Set a value at a nested path, creating intermediate objects as needed
|
|
77
|
+
*/
|
|
78
|
+
private setAt(path: string[], value: SQLNamespace): void {
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
80
|
+
let current: any = this.schema;
|
|
81
|
+
for (const key of path.slice(0, -1)) {
|
|
82
|
+
if (!current[key]) {
|
|
83
|
+
current[key] = { children: {} };
|
|
84
|
+
}
|
|
85
|
+
current = current[key].children;
|
|
86
|
+
}
|
|
87
|
+
current[path[path.length - 1]] = value;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Build the final schema
|
|
92
|
+
*/
|
|
93
|
+
build(): SQLNamespace {
|
|
94
|
+
return this.schema;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Reset for reuse
|
|
99
|
+
*/
|
|
100
|
+
reset(): this {
|
|
101
|
+
this.schema = {};
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function columnToCompletion(opts: { column: DataTableColumn }): Completion {
|
|
107
|
+
return {
|
|
108
|
+
label: opts.column.name,
|
|
109
|
+
type: "column",
|
|
110
|
+
info: () => {
|
|
111
|
+
const dom = document.createElement("div");
|
|
112
|
+
createRoot(dom).render(renderColumnInfo(opts.column));
|
|
113
|
+
return { dom: dom };
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function tableToCompletion(opts: { table: DataTable }): Completion {
|
|
119
|
+
return {
|
|
120
|
+
label: opts.table.name,
|
|
121
|
+
type: "table",
|
|
122
|
+
info: () => {
|
|
123
|
+
const dom = document.createElement("div");
|
|
124
|
+
createRoot(dom).render(renderTableInfo(opts.table));
|
|
125
|
+
return { dom: dom };
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function schemaToCompletion(opts: {
|
|
131
|
+
namespace: DatabaseSchema;
|
|
132
|
+
path: string[];
|
|
133
|
+
}): Completion {
|
|
134
|
+
return {
|
|
135
|
+
label: opts.namespace.name,
|
|
136
|
+
detail: opts.path.join("."),
|
|
137
|
+
type: "schema",
|
|
138
|
+
info: () => {
|
|
139
|
+
const dom = document.createElement("div");
|
|
140
|
+
createRoot(dom).render(renderSchemaInfo(opts.namespace));
|
|
141
|
+
return { dom: dom };
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function databaseToCompletion(opts: {
|
|
147
|
+
namespace: Database;
|
|
148
|
+
path: string[];
|
|
149
|
+
}): Completion {
|
|
150
|
+
return {
|
|
151
|
+
label: opts.namespace.name,
|
|
152
|
+
detail: opts.path.join("."),
|
|
153
|
+
type: "database",
|
|
154
|
+
info: () => {
|
|
155
|
+
const dom = document.createElement("div");
|
|
156
|
+
createRoot(dom).render(renderDatabaseInfo(opts.namespace));
|
|
157
|
+
return { dom: dom };
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from "@codemirror/lang-sql";
|
|
8
8
|
import type { EditorState } from "@codemirror/state";
|
|
9
9
|
import { DefaultSqlTooltipRenders } from "@marimo-team/codemirror-sql";
|
|
10
|
+
import { once } from "@/utils/once";
|
|
10
11
|
import { languageMetadataField } from "../../metadata";
|
|
11
12
|
import { SCHEMA_CACHE } from "./completion-store";
|
|
12
13
|
import type { SQLLanguageAdapterMetadata } from "./sql";
|
|
@@ -28,7 +29,12 @@ export function tablesCompletionSource(): CompletionSource {
|
|
|
28
29
|
return null;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
const completions = schemaCompletionSource(config)(ctx);
|
|
33
|
+
if (!completions) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return completions;
|
|
32
38
|
};
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -84,7 +90,7 @@ export function customKeywordCompletionSource(): CompletionSource {
|
|
|
84
90
|
}
|
|
85
91
|
|
|
86
92
|
// e.g. lazily load keyword docs
|
|
87
|
-
const getKeywordDocs = async (): Promise<Record<string, unknown>> => {
|
|
93
|
+
const getKeywordDocs = once(async (): Promise<Record<string, unknown>> => {
|
|
88
94
|
const keywords = await import(
|
|
89
95
|
"@marimo-team/codemirror-sql/data/common-keywords.json"
|
|
90
96
|
);
|
|
@@ -96,4 +102,4 @@ const getKeywordDocs = async (): Promise<Record<string, unknown>> => {
|
|
|
96
102
|
...keywords.default.keywords,
|
|
97
103
|
...duckdbKeywords.default.keywords,
|
|
98
104
|
};
|
|
99
|
-
};
|
|
105
|
+
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* Copyright 2024 Marimo. All rights reserved. */
|
|
2
2
|
|
|
3
3
|
import type { SQLConfig, SQLDialect } from "@codemirror/lang-sql";
|
|
4
|
+
import { atom } from "jotai";
|
|
4
5
|
import { isSchemaless } from "@/components/datasources/utils";
|
|
5
6
|
import { dataConnectionsMapAtom } from "@/core/datasets/data-source-connections";
|
|
6
7
|
import type { ConnectionName } from "@/core/datasets/engines";
|
|
@@ -8,14 +9,22 @@ import { datasetTablesAtom } from "@/core/datasets/state";
|
|
|
8
9
|
import type { DataSourceConnection } from "@/core/kernel/messages";
|
|
9
10
|
import { store } from "@/core/state/jotai";
|
|
10
11
|
import { LRUCache } from "@/utils/lru";
|
|
12
|
+
import { CompletionBuilder } from "./completion-builder";
|
|
11
13
|
import { guessDialect, ModifiedStandardSQL } from "./utils";
|
|
12
14
|
|
|
13
|
-
type TableToCols = Record<string, string[]>;
|
|
14
|
-
type Schemas = Record<string, TableToCols>;
|
|
15
15
|
type CachedSchema = Pick<SQLConfig, "schema" | "defaultSchema"> & {
|
|
16
16
|
shouldAddLocalTables: boolean;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
+
const datasetTableCompletionsAtom = atom((get) => {
|
|
20
|
+
const tables = get(datasetTablesAtom);
|
|
21
|
+
const builder = new CompletionBuilder();
|
|
22
|
+
for (const table of tables) {
|
|
23
|
+
builder.addTable([], table);
|
|
24
|
+
}
|
|
25
|
+
return builder.build();
|
|
26
|
+
});
|
|
27
|
+
|
|
19
28
|
class SQLCompletionStore {
|
|
20
29
|
private cache: LRUCache<DataSourceConnection, CachedSchema>;
|
|
21
30
|
|
|
@@ -33,81 +42,74 @@ class SQLCompletionStore {
|
|
|
33
42
|
}
|
|
34
43
|
|
|
35
44
|
private getConnectionSchema(connection: DataSourceConnection): CachedSchema {
|
|
36
|
-
const
|
|
37
|
-
const
|
|
45
|
+
const { default_database, databases, default_schema } = connection;
|
|
46
|
+
const builder = new CompletionBuilder();
|
|
38
47
|
|
|
39
48
|
// When there is only one database, it is the default
|
|
40
|
-
const defaultDb =
|
|
41
|
-
(db) =>
|
|
42
|
-
db.name === connection.default_database ||
|
|
43
|
-
connection.databases.length === 1,
|
|
49
|
+
const defaultDb = databases.find(
|
|
50
|
+
(db) => db.name === default_database || databases.length === 1,
|
|
44
51
|
);
|
|
45
52
|
|
|
46
|
-
const dbToVerify = defaultDb ??
|
|
53
|
+
const dbToVerify = defaultDb ?? databases[0];
|
|
47
54
|
const isSchemalessDb =
|
|
48
55
|
dbToVerify?.schemas.some((schema) => isSchemaless(schema.name)) ?? false;
|
|
49
56
|
|
|
50
57
|
// For schemaless databases, treat databases as schemas
|
|
51
58
|
if (isSchemalessDb) {
|
|
52
|
-
|
|
53
|
-
const dbToTablesMap: Record<string, any> = {};
|
|
54
|
-
|
|
55
|
-
for (const db of connection.databases) {
|
|
59
|
+
for (const db of databases) {
|
|
56
60
|
const isDefaultDb = db.name === defaultDb?.name;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
dbToTablesMap[db.name] = dbToTablesMap[db.name] || {};
|
|
68
|
-
dbToTablesMap[db.name][table.name] = columns;
|
|
69
|
-
}
|
|
61
|
+
const tables = db.schemas.flatMap((schema) => schema.tables);
|
|
62
|
+
builder.addDatabase([db.name], db);
|
|
63
|
+
|
|
64
|
+
for (const table of tables) {
|
|
65
|
+
if (isDefaultDb) {
|
|
66
|
+
// For default database, add tables directly to top level
|
|
67
|
+
builder.addTable([], table);
|
|
68
|
+
} else {
|
|
69
|
+
// Otherwise nest under database name
|
|
70
|
+
builder.addTable([db.name], table);
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
return {
|
|
75
76
|
shouldAddLocalTables: false,
|
|
76
|
-
schema:
|
|
77
|
+
schema: builder.build(),
|
|
77
78
|
defaultSchema: defaultDb?.name,
|
|
78
79
|
};
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
// For default db, we can use the schema name directly
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
// For default db, we can use the schema name directly so add them to the top level
|
|
83
|
+
if (defaultDb) {
|
|
84
|
+
for (const schema of defaultDb.schemas) {
|
|
85
|
+
builder.addSchema([schema.name], schema);
|
|
86
|
+
|
|
87
|
+
for (const table of schema.tables) {
|
|
88
|
+
builder.addTable([schema.name], table);
|
|
89
|
+
}
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
|
|
90
93
|
// Otherwise, we need to use the fully qualified name
|
|
91
|
-
for (const database of
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
for (const database of databases) {
|
|
95
|
+
// We still want to add the default database here in case
|
|
96
|
+
// users want fully qualified names for completions
|
|
97
|
+
|
|
98
|
+
builder.addDatabase([database.name], database);
|
|
96
99
|
|
|
97
100
|
for (const schema of database.schemas) {
|
|
98
|
-
|
|
101
|
+
builder.addSchema([database.name, schema.name], schema);
|
|
99
102
|
|
|
100
103
|
for (const table of schema.tables) {
|
|
101
|
-
|
|
102
|
-
databaseMap[database.name][schema.name][table.name] = columns;
|
|
104
|
+
builder.addTable([database.name, schema.name], table);
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
return {
|
|
108
110
|
shouldAddLocalTables: true,
|
|
109
|
-
schema:
|
|
110
|
-
defaultSchema:
|
|
111
|
+
schema: builder.build(),
|
|
112
|
+
defaultSchema: default_schema ?? undefined,
|
|
111
113
|
};
|
|
112
114
|
}
|
|
113
115
|
|
|
@@ -142,15 +144,9 @@ class SQLCompletionStore {
|
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
const getTablesMap = () => {
|
|
145
|
-
const localTables = store.get(datasetTablesAtom);
|
|
146
147
|
// If there is a conflict with connection tables,
|
|
147
148
|
// the engine will prioritize the connection tables without special handling
|
|
148
|
-
|
|
149
|
-
for (const table of localTables) {
|
|
150
|
-
const tableColumns = table.columns.map((col) => col.name);
|
|
151
|
-
tablesMap[table.name] = tableColumns;
|
|
152
|
-
}
|
|
153
|
-
return tablesMap;
|
|
149
|
+
return store.get(datasetTableCompletionsAtom);
|
|
154
150
|
};
|
|
155
151
|
|
|
156
152
|
const schema = this.cache.getOrCreate(connection);
|