@marimo-team/frontend 0.23.16-dev50 → 0.23.16-dev52
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/{CellStatus-DciB5rbr.js → CellStatus-BT88_2jw.js} +1 -1
- package/dist/assets/{JsonOutput-BM3vve9F.js → JsonOutput-0XYUxjxO.js} +12 -12
- package/dist/assets/{MarimoErrorOutput-Bh0y53Du.js → MarimoErrorOutput-DuwnzR5D.js} +4 -4
- package/dist/assets/{RenderHTML-B9jx7Dsm.js → RenderHTML-BPdXbewN.js} +1 -1
- package/dist/assets/{RunButton-DMtHbFuA.js → RunButton-DJyvIhMO.js} +1 -1
- package/dist/assets/{add-cell-with-ai-BcRYriMM.js → add-cell-with-ai-Dspw1-mO.js} +12 -12
- package/dist/assets/add-connection-dialog-B1fFBVqJ.js +178 -0
- package/dist/assets/{agent-panel-B31W_VwU.js → agent-panel-iPdDqSEd.js} +4 -4
- package/dist/assets/{ai-model-dropdown-B3D05oQh.js → ai-model-dropdown-BC1SNLKb.js} +3 -3
- package/dist/assets/{app-config-button-D_mjovwU.js → app-config-button-CuE-bLFn.js} +1 -1
- package/dist/assets/{blob-BJREJiQp.js → blob-C23KHI9W.js} +1 -1
- package/dist/assets/{cell-editor-BOhZHoLm.js → cell-editor-D8UAfiUa.js} +11 -11
- package/dist/assets/cell-link-Bu5k33_H.js +1 -0
- package/dist/assets/{cells-Jr-5Pc9f.js → cells-C3V6s-g5.js} +53 -53
- package/dist/assets/{chat-display-Djy1Jt6b.js → chat-display-DSMFTDiK.js} +1 -1
- package/dist/assets/{chat-panel-B2nYSE_l.js → chat-panel-DuGaXa17.js} +4 -4
- package/dist/assets/{chat-ui-DlG0En7w.js → chat-ui-TD66NC03.js} +4 -4
- package/dist/assets/{column-preview-BUHlI5va.js → column-preview-Dqt5ygdi.js} +1 -1
- package/dist/assets/{command-palette-rEJmXCZM.js → command-palette-DgyUILpb.js} +1 -1
- package/dist/assets/{common-CZc3fQI4.js → common-CIJsW5yR.js} +1 -1
- package/dist/assets/{components-GAYCj6Mx.js → components-CniQJAsf.js} +1 -1
- package/dist/assets/{datasource-AWkkAeiS.js → datasource-YLl5kKpx.js} +2 -2
- package/dist/assets/{dependency-graph-panel-wcqTPq6b.js → dependency-graph-panel-MPHqARlX.js} +4 -4
- package/dist/assets/{documentation-panel-Eu8MIkoU.js → documentation-panel-DZnNktBv.js} +1 -1
- package/dist/assets/{download-CQ7iZFJL.js → download-CSWknseP.js} +2 -2
- package/dist/assets/{edit-page-zyK_cMuR.js → edit-page-DVXg8Ibp.js} +6 -6
- package/dist/assets/error-entries-DIjVQBFa.js +8 -0
- package/dist/assets/{error-panel-BZzr0PA1.js → error-panel-CJSBDHOq.js} +1 -1
- package/dist/assets/{file-explorer-panel-C1W7g_Wp.js → file-explorer-panel-sHVZyshk.js} +4 -4
- package/dist/assets/{file-icons-BAqZR08W.js → file-icons-DDUQU--N.js} +1 -1
- package/dist/assets/{file-name-input-0MiZVw5r.js → file-name-input-CQjQP_zG.js} +1 -1
- package/dist/assets/{floating-outline-C6g75zrP.js → floating-outline-D1iQUiR_.js} +1 -1
- package/dist/assets/{focus-C0HXXg3V.js → focus-D_UTw9HF.js} +1 -1
- package/dist/assets/{form-C051zAev.js → form-B6jUSJBp.js} +1 -1
- package/dist/assets/{form-DT44Rmhp.js → form-Bp7lk3pm.js} +1 -1
- package/dist/assets/{home-page-CJz9IHZ2.js → home-page-CX6IV-hM.js} +2 -2
- package/dist/assets/{html-to-image-CfjhKLA4.js → html-to-image-kpOREGyr.js} +2 -2
- package/dist/assets/index-8Nlyq3mV.css +2 -0
- package/dist/assets/{index-BGE_j_ZS.js → index-CrJhpWGp.js} +6 -6
- package/dist/assets/{layout-D4bpsgVD.js → layout-DdPE4xZU.js} +5 -5
- package/dist/assets/{logs-panel-CsaY3O1m.js → logs-panel-DnNiJzUQ.js} +1 -1
- package/dist/assets/{markdown-renderer-BgqeO4JR.js → markdown-renderer-CqljiwGm.js} +2 -2
- package/dist/assets/{name-cell-input-DcU8Rfrz.js → name-cell-input-BQzQI3Ja.js} +1 -1
- package/dist/assets/{outline-panel-D-CHPZQM.js → outline-panel-BIgVnAC7.js} +1 -1
- package/dist/assets/{packages-panel-dq7QVZl1.js → packages-panel-_HiSQVV7.js} +1 -1
- package/dist/assets/panels-b-OL36p2.js +4 -0
- package/dist/assets/{process-output-NbwnUu05.js → process-output-CJkR5qgD.js} +1 -1
- package/dist/assets/{radio-group-rhQpGwU-.js → radio-group-Dm-ZV-tP.js} +1 -1
- package/dist/assets/readonly-code-display-BiNt9i32.js +1 -0
- package/dist/assets/{readonly-python-code-Q_1Y3VyZ.js → readonly-python-code-DMKb3G0K.js} +1 -1
- package/dist/assets/{reveal-component-CedpDwM8.js → reveal-component-DN6-mIsb.js} +2 -2
- package/dist/assets/{run-page-CGoux5cj.js → run-page-BKCqJ0uJ.js} +1 -1
- package/dist/assets/scratchpad-panel-DwZEAfW1.js +1 -0
- package/dist/assets/{session-panel-OIot3eyB.js → session-panel-B-9BnZxS.js} +1 -1
- package/dist/assets/{skeleton-BRvjFlRu.js → skeleton-B72xXZAF.js} +1 -1
- package/dist/assets/{snippets-panel-YFyH2hUM.js → snippets-panel-Brc_pmTk.js} +1 -1
- package/dist/assets/{state-bHyw5u3R.js → state-BTAocii6.js} +1 -1
- package/dist/assets/state-D9oG57zx.js +3 -0
- package/dist/assets/{tracing-CDMM1BB2.js → tracing-Cn9cTT65.js} +1 -1
- package/dist/assets/{tracing-panel-BH5Zbvl9.js → tracing-panel-FWoe3_eY.js} +2 -2
- package/dist/assets/{tree-actions-DDveUIHK.js → tree-actions-rPl1v1gM.js} +1 -1
- package/dist/assets/useCellActionButton-Du3JXpNf.js +1 -0
- package/dist/assets/{useDeleteCell-BIopCngo.js → useDeleteCell-DHOwR-CG.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-snM337f9.js → useDependencyPanelTab-B2PCtSi6.js} +1 -1
- package/dist/assets/{useNotebookActions-CsZfWFKy.js → useNotebookActions-DfQAtofT.js} +4 -4
- package/dist/assets/useRunCells-Dg11M4pT.js +1 -0
- package/dist/assets/{useSplitCell-BTmKY1CU.js → useSplitCell-BwWVHida.js} +1 -1
- package/dist/index.html +24 -24
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +1 -0
- package/src/components/editor/connections/__tests__/quick-add-data-sources.test.tsx +113 -0
- package/src/components/editor/connections/add-connection-dialog.tsx +2 -0
- package/src/components/editor/connections/quick-add-data-sources.tsx +106 -0
- package/src/components/editor/viewer-banner.tsx +4 -2
- package/src/core/datasets/data-source-discovery.ts +5 -0
- package/src/core/datasets/request-registry.ts +11 -0
- package/src/core/islands/bootstrap.ts +1 -0
- package/src/core/islands/bridge.ts +1 -0
- package/src/core/kernel/messages.ts +2 -0
- package/src/core/network/__tests__/requests-lazy.test.ts +15 -0
- package/src/core/network/__tests__/requests-network.test.ts +14 -0
- package/src/core/network/requests-lazy.ts +1 -0
- package/src/core/network/requests-network.ts +8 -0
- package/src/core/network/requests-static.ts +1 -0
- package/src/core/network/requests-toasting.tsx +1 -0
- package/src/core/network/types.ts +2 -0
- package/src/core/wasm/bridge.ts +10 -0
- package/src/core/websocket/useMarimoKernelConnection.tsx +4 -0
- package/src/hooks/__tests__/useDataSourceDiscovery.test.ts +80 -0
- package/src/hooks/useDataSourceDiscovery.ts +18 -0
- package/dist/assets/add-connection-dialog-syjRSNPT.js +0 -178
- package/dist/assets/cell-link-DqNEv3f9.js +0 -1
- package/dist/assets/error-entries-Cr8uVukN.js +0 -8
- package/dist/assets/index-D6Dp_PFj.css +0 -2
- package/dist/assets/panels-DWoniKhE.js +0 -4
- package/dist/assets/readonly-code-display-CVY2f7EZ.js +0 -1
- package/dist/assets/scratchpad-panel-BLuF25yR.js +0 -1
- package/dist/assets/state-DB_fxbhn.js +0 -3
- package/dist/assets/useCellActionButton-D5ix_g2a.js +0 -1
- package/dist/assets/useRunCells-CF_V8X2K.js +0 -1
package/dist/index.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
67
67
|
<!-- /TODO -->
|
|
68
68
|
<title>{{ title }}</title>
|
|
69
|
-
<script type="module" crossorigin src="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-CrJhpWGp.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-TXkS1QI3.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/objects-BlG0ZrO0.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
<link rel="modulepreload" crossorigin href="./assets/debounce-OiXznToA.js">
|
|
135
135
|
<link rel="modulepreload" crossorigin href="./assets/database-zap-CKO8g4BU.js">
|
|
136
136
|
<link rel="modulepreload" crossorigin href="./assets/main-BNL5rxQw.js">
|
|
137
|
-
<link rel="modulepreload" crossorigin href="./assets/cells-
|
|
137
|
+
<link rel="modulepreload" crossorigin href="./assets/cells-C3V6s-g5.js">
|
|
138
138
|
<link rel="modulepreload" crossorigin href="./assets/kbd-C5HnBH5U.js">
|
|
139
139
|
<link rel="modulepreload" crossorigin href="./assets/useInstallPackage-WiYBwhUO.js">
|
|
140
140
|
<link rel="modulepreload" crossorigin href="./assets/alert-dialog-Bb8Lz8ko.js">
|
|
@@ -147,40 +147,40 @@
|
|
|
147
147
|
<link rel="modulepreload" crossorigin href="./assets/usePress-5hBv4sjD.js">
|
|
148
148
|
<link rel="modulepreload" crossorigin href="./assets/input-JxFwu-3G.js">
|
|
149
149
|
<link rel="modulepreload" crossorigin href="./assets/ImperativeModal-fY-ZfT0b.js">
|
|
150
|
-
<link rel="modulepreload" crossorigin href="./assets/cell-link-
|
|
150
|
+
<link rel="modulepreload" crossorigin href="./assets/cell-link-Bu5k33_H.js">
|
|
151
151
|
<link rel="modulepreload" crossorigin href="./assets/config-BJVx3eBW.js">
|
|
152
152
|
<link rel="modulepreload" crossorigin href="./assets/alert-jlwhGxSb.js">
|
|
153
153
|
<link rel="modulepreload" crossorigin href="./assets/chevron-right-BS_NcSch.js">
|
|
154
154
|
<link rel="modulepreload" crossorigin href="./assets/dropdown-menu-dHmZR8bI.js">
|
|
155
155
|
<link rel="modulepreload" crossorigin href="./assets/links-wcQA1Np1.js">
|
|
156
|
-
<link rel="modulepreload" crossorigin href="./assets/useRunCells-
|
|
156
|
+
<link rel="modulepreload" crossorigin href="./assets/useRunCells-Dg11M4pT.js">
|
|
157
157
|
<link rel="modulepreload" crossorigin href="./assets/copy-Bxb1_Gtw.js">
|
|
158
158
|
<link rel="modulepreload" crossorigin href="./assets/copy-3iHFdt22.js">
|
|
159
159
|
<link rel="modulepreload" crossorigin href="./assets/copy-icon-neDQUo4Q.js">
|
|
160
|
-
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-
|
|
161
|
-
<link rel="modulepreload" crossorigin href="./assets/datasource-
|
|
162
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
160
|
+
<link rel="modulepreload" crossorigin href="./assets/RenderHTML-BPdXbewN.js">
|
|
161
|
+
<link rel="modulepreload" crossorigin href="./assets/datasource-YLl5kKpx.js">
|
|
162
|
+
<link rel="modulepreload" crossorigin href="./assets/state-BTAocii6.js">
|
|
163
163
|
<link rel="modulepreload" crossorigin href="./assets/hat-glasses-BttHlyvs.js">
|
|
164
164
|
<link rel="modulepreload" crossorigin href="./assets/package-Bxz_8e44.js">
|
|
165
165
|
<link rel="modulepreload" crossorigin href="./assets/sparkles-DUCpRFlS.js">
|
|
166
|
-
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-
|
|
166
|
+
<link rel="modulepreload" crossorigin href="./assets/MarimoErrorOutput-DuwnzR5D.js">
|
|
167
167
|
<link rel="modulepreload" crossorigin href="./assets/ErrorBoundary-DzTD8LVq.js">
|
|
168
168
|
<link rel="modulepreload" crossorigin href="./assets/eye-off-BOZA7gbn.js">
|
|
169
169
|
<link rel="modulepreload" crossorigin href="./assets/refresh-cw-CYq4mK5a.js">
|
|
170
|
-
<link rel="modulepreload" crossorigin href="./assets/tree-actions-
|
|
170
|
+
<link rel="modulepreload" crossorigin href="./assets/tree-actions-rPl1v1gM.js">
|
|
171
171
|
<link rel="modulepreload" crossorigin href="./assets/spinner-D-V4psAa.js">
|
|
172
|
-
<link rel="modulepreload" crossorigin href="./assets/html-to-image-
|
|
173
|
-
<link rel="modulepreload" crossorigin href="./assets/focus-
|
|
172
|
+
<link rel="modulepreload" crossorigin href="./assets/html-to-image-kpOREGyr.js">
|
|
173
|
+
<link rel="modulepreload" crossorigin href="./assets/focus-D_UTw9HF.js">
|
|
174
174
|
<link rel="modulepreload" crossorigin href="./assets/useAsyncData-Bg5iAViP.js">
|
|
175
175
|
<link rel="modulepreload" crossorigin href="./assets/LazyAnyLanguageCodeMirror-DPOEues4.js">
|
|
176
176
|
<link rel="modulepreload" crossorigin href="./assets/micromark-factory-space-Dx_STMJD.js">
|
|
177
177
|
<link rel="modulepreload" crossorigin href="./assets/chunk-5FQGJX7Z-BEbM01OT.js">
|
|
178
|
-
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-
|
|
178
|
+
<link rel="modulepreload" crossorigin href="./assets/markdown-renderer-CqljiwGm.js">
|
|
179
179
|
<link rel="modulepreload" crossorigin href="./assets/command-Dqxie4gq.js">
|
|
180
180
|
<link rel="modulepreload" crossorigin href="./assets/field-BsxD35VE.js">
|
|
181
181
|
<link rel="modulepreload" crossorigin href="./assets/popover-Bcz1Zikb.js">
|
|
182
182
|
<link rel="modulepreload" crossorigin href="./assets/errors-PgHhDa-M.js">
|
|
183
|
-
<link rel="modulepreload" crossorigin href="./assets/download-
|
|
183
|
+
<link rel="modulepreload" crossorigin href="./assets/download-CSWknseP.js">
|
|
184
184
|
<link rel="modulepreload" crossorigin href="./assets/table-CH2plyy9.js">
|
|
185
185
|
<link rel="modulepreload" crossorigin href="./assets/useIframeCapabilities-j6fR_dBA.js">
|
|
186
186
|
<link rel="modulepreload" crossorigin href="./assets/error-banner-BSxEOIn2.js">
|
|
@@ -201,34 +201,34 @@
|
|
|
201
201
|
<link rel="modulepreload" crossorigin href="./assets/plus-AgXtozBz.js">
|
|
202
202
|
<link rel="modulepreload" crossorigin href="./assets/trash-2-72W0TZ3L.js">
|
|
203
203
|
<link rel="modulepreload" crossorigin href="./assets/react-resizable-panels.browser.esm-Z-MD3n3J.js">
|
|
204
|
-
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-
|
|
204
|
+
<link rel="modulepreload" crossorigin href="./assets/JsonOutput-0XYUxjxO.js">
|
|
205
205
|
<link rel="modulepreload" crossorigin href="./assets/chart-no-axes-column-iDRxid4h.js">
|
|
206
206
|
<link rel="modulepreload" crossorigin href="./assets/square-function-DNNRTPQJ.js">
|
|
207
207
|
<link rel="modulepreload" crossorigin href="./assets/spec-C7opZZRp.js">
|
|
208
|
-
<link rel="modulepreload" crossorigin href="./assets/column-preview-
|
|
208
|
+
<link rel="modulepreload" crossorigin href="./assets/column-preview-Dqt5ygdi.js">
|
|
209
209
|
<link rel="modulepreload" crossorigin href="./assets/icons-CIPE8AIY.js">
|
|
210
|
-
<link rel="modulepreload" crossorigin href="./assets/radio-group-
|
|
211
|
-
<link rel="modulepreload" crossorigin href="./assets/floating-outline-
|
|
210
|
+
<link rel="modulepreload" crossorigin href="./assets/radio-group-Dm-ZV-tP.js">
|
|
211
|
+
<link rel="modulepreload" crossorigin href="./assets/floating-outline-D1iQUiR_.js">
|
|
212
212
|
<link rel="modulepreload" crossorigin href="./assets/switch-OVajJBPR.js">
|
|
213
213
|
<link rel="modulepreload" crossorigin href="./assets/objectWithoutPropertiesLoose-CboCOq4o.js">
|
|
214
214
|
<link rel="modulepreload" crossorigin href="./assets/esm-B30N1GS0.js">
|
|
215
|
-
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-
|
|
215
|
+
<link rel="modulepreload" crossorigin href="./assets/readonly-python-code-DMKb3G0K.js">
|
|
216
216
|
<link rel="modulepreload" crossorigin href="./assets/file-headphone-DAu6VO6j.js">
|
|
217
217
|
<link rel="modulepreload" crossorigin href="./assets/file-CJH9JNGH.js">
|
|
218
218
|
<link rel="modulepreload" crossorigin href="./assets/image-5XI2VU-q.js">
|
|
219
|
-
<link rel="modulepreload" crossorigin href="./assets/file-icons-
|
|
219
|
+
<link rel="modulepreload" crossorigin href="./assets/file-icons-DDUQU--N.js">
|
|
220
220
|
<link rel="modulepreload" crossorigin href="./assets/events-90X9nql5.js">
|
|
221
221
|
<link rel="modulepreload" crossorigin href="./assets/share-852X_cqy.js">
|
|
222
|
-
<link rel="modulepreload" crossorigin href="./assets/blob-
|
|
222
|
+
<link rel="modulepreload" crossorigin href="./assets/blob-C23KHI9W.js">
|
|
223
223
|
<link rel="modulepreload" crossorigin href="./assets/memoize-Tp7rARFe.js">
|
|
224
224
|
<link rel="modulepreload" crossorigin href="./assets/get-C-qh_et5.js">
|
|
225
225
|
<link rel="modulepreload" crossorigin href="./assets/_baseSet-CsW0tABf.js">
|
|
226
|
-
<link rel="modulepreload" crossorigin href="./assets/state-
|
|
226
|
+
<link rel="modulepreload" crossorigin href="./assets/state-D9oG57zx.js">
|
|
227
227
|
<link rel="modulepreload" crossorigin href="./assets/label-CqjrpwRC.js">
|
|
228
|
-
<link rel="modulepreload" crossorigin href="./assets/form-
|
|
228
|
+
<link rel="modulepreload" crossorigin href="./assets/form-B6jUSJBp.js">
|
|
229
229
|
<link rel="modulepreload" crossorigin href="./assets/textarea-DZB2bzVL.js">
|
|
230
230
|
<link rel="modulepreload" crossorigin href="./assets/refresh-ccw-sLaKP2vj.js">
|
|
231
|
-
<link rel="modulepreload" crossorigin href="./assets/form-
|
|
231
|
+
<link rel="modulepreload" crossorigin href="./assets/form-Bp7lk3pm.js">
|
|
232
232
|
<link rel="modulepreload" crossorigin href="./assets/renderShortcut-Bl8_FVn8.js">
|
|
233
233
|
<link rel="modulepreload" crossorigin href="./assets/useBoolean-CFj86iac.js">
|
|
234
234
|
<link rel="modulepreload" crossorigin href="./assets/useDeepCompareMemoize-CSMoa-ga.js">
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
<link rel="stylesheet" crossorigin href="./assets/cells-BVzo2MHf.css">
|
|
251
251
|
<link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DdDKmWlR.css">
|
|
252
252
|
<link rel="stylesheet" crossorigin href="./assets/JsonOutput-BQtz7-np.css">
|
|
253
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
253
|
+
<link rel="stylesheet" crossorigin href="./assets/index-8Nlyq3mV.css">
|
|
254
254
|
</head>
|
|
255
255
|
<body>
|
|
256
256
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -41,6 +41,7 @@ export const MockRequestClient = {
|
|
|
41
41
|
previewSQLTableList: vi.fn().mockResolvedValue({ tables: [] }),
|
|
42
42
|
previewSQLSchemaList: vi.fn().mockResolvedValue({ schemas: [] }),
|
|
43
43
|
previewDataSourceConnection: vi.fn().mockResolvedValue({}),
|
|
44
|
+
discoverDataSources: vi.fn().mockResolvedValue({}),
|
|
44
45
|
validateSQL: vi.fn().mockResolvedValue({}),
|
|
45
46
|
openFile: vi.fn().mockResolvedValue({}),
|
|
46
47
|
getUsageStats: vi.fn().mockResolvedValue({}),
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { fireEvent, render, screen, waitFor } from "@testing-library/react";
|
|
4
|
+
import { describe, expect, it, vi } from "vitest";
|
|
5
|
+
import type { DetectedDataSource } from "@/core/datasets/data-source-discovery";
|
|
6
|
+
import { QuickAddDataSources } from "../quick-add-data-sources";
|
|
7
|
+
|
|
8
|
+
const sources: DetectedDataSource[] = [
|
|
9
|
+
{
|
|
10
|
+
id: "postgres-libpq-environment",
|
|
11
|
+
integration: "postgres",
|
|
12
|
+
category: "database",
|
|
13
|
+
displayName: "PostgreSQL",
|
|
14
|
+
confidence: "high",
|
|
15
|
+
origins: [{ type: "environment", label: "Kernel environment" }],
|
|
16
|
+
configuration: [
|
|
17
|
+
{
|
|
18
|
+
field: "Host",
|
|
19
|
+
value: { kind: "environment-variable", name: "PGHOST" },
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
field: "Username",
|
|
23
|
+
value: { kind: "environment-variable", name: "PGUSER" },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
field: "Database",
|
|
27
|
+
value: { kind: "environment-variable", name: "PGDATABASE" },
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
code: "engine = create_engine()",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "pyiceberg-prod",
|
|
34
|
+
integration: "pyiceberg",
|
|
35
|
+
category: "catalog",
|
|
36
|
+
displayName: "PyIceberg (prod)",
|
|
37
|
+
confidence: "high",
|
|
38
|
+
origins: [
|
|
39
|
+
{
|
|
40
|
+
type: "configuration",
|
|
41
|
+
label: "Resolved PyIceberg configuration",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
configuration: [
|
|
45
|
+
{
|
|
46
|
+
field: "Catalog",
|
|
47
|
+
value: { kind: "safe-literal", value: "prod" },
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
field: "Type",
|
|
51
|
+
value: { kind: "safe-literal", value: "REST" },
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
code: 'catalog = load_catalog("prod")',
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
describe("QuickAddDataSources", () => {
|
|
59
|
+
it("does not render an empty section", () => {
|
|
60
|
+
const { container } = render(
|
|
61
|
+
<QuickAddDataSources sources={[]} onAdd={vi.fn()} />,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
expect(container).toBeEmptyDOMElement();
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it("renders detected sources as clickable tags", () => {
|
|
68
|
+
const onAdd = vi.fn();
|
|
69
|
+
|
|
70
|
+
render(<QuickAddDataSources sources={sources} onAdd={onAdd} />);
|
|
71
|
+
fireEvent.click(
|
|
72
|
+
screen.getByRole("button", {
|
|
73
|
+
name: "Add PostgreSQL connection",
|
|
74
|
+
}),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
expect(screen.getByText("Quick add")).toBeInTheDocument();
|
|
78
|
+
expect(onAdd).toHaveBeenCalledWith(sources[0]);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it("shows environment references on hover", async () => {
|
|
82
|
+
render(<QuickAddDataSources sources={sources} onAdd={vi.fn()} />);
|
|
83
|
+
const tag = screen.getByRole("button", {
|
|
84
|
+
name: "Add PostgreSQL connection",
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
fireEvent.pointerMove(tag);
|
|
88
|
+
fireEvent.mouseOver(tag);
|
|
89
|
+
|
|
90
|
+
await waitFor(() => {
|
|
91
|
+
expect(screen.getAllByText('os.environ["PGHOST"]')).not.toHaveLength(0);
|
|
92
|
+
});
|
|
93
|
+
expect(screen.getAllByText('os.environ["PGUSER"]')).not.toHaveLength(0);
|
|
94
|
+
expect(screen.getAllByText('os.environ["PGDATABASE"]')).not.toHaveLength(0);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("shows safe configuration metadata on hover", async () => {
|
|
98
|
+
render(<QuickAddDataSources sources={sources} onAdd={vi.fn()} />);
|
|
99
|
+
const tag = screen.getByRole("button", {
|
|
100
|
+
name: "Add PyIceberg (prod) connection",
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
fireEvent.pointerMove(tag);
|
|
104
|
+
fireEvent.mouseOver(tag);
|
|
105
|
+
|
|
106
|
+
await waitFor(() => {
|
|
107
|
+
expect(
|
|
108
|
+
screen.getAllByText("Detected from Resolved PyIceberg configuration"),
|
|
109
|
+
).not.toHaveLength(0);
|
|
110
|
+
});
|
|
111
|
+
expect(screen.getAllByText("REST")).not.toHaveLength(0);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import { ExternalLink } from "@/components/ui/links";
|
|
13
13
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
14
14
|
import { AddDatabaseForm } from "./database/add-database-form";
|
|
15
|
+
import { AutoDiscoveredDataSources } from "./quick-add-data-sources";
|
|
15
16
|
import { AddStorageForm } from "./storage/add-storage-form";
|
|
16
17
|
|
|
17
18
|
type ConnectionTab = "databases" | "storage";
|
|
@@ -86,6 +87,7 @@ export const AddConnectionDialogContent: React.FC<{
|
|
|
86
87
|
<span className="block">{codeSnippetHint}</span>
|
|
87
88
|
</DialogDescription>
|
|
88
89
|
</DialogHeader>
|
|
90
|
+
<AutoDiscoveredDataSources onSubmit={onClose} />
|
|
89
91
|
<Tabs
|
|
90
92
|
value={activeTab}
|
|
91
93
|
onValueChange={(v) => setActiveTab(v as ConnectionTab)}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { PlusIcon, SparklesIcon } from "lucide-react";
|
|
4
|
+
import { Tooltip, TooltipProvider } from "@/components/ui/tooltip";
|
|
5
|
+
import type { DetectedDataSource } from "@/core/datasets/data-source-discovery";
|
|
6
|
+
import { useDataSourceDiscovery } from "@/hooks/useDataSourceDiscovery";
|
|
7
|
+
import { useInsertCode } from "./components";
|
|
8
|
+
|
|
9
|
+
export const QuickAddDataSources: React.FC<{
|
|
10
|
+
sources: DetectedDataSource[];
|
|
11
|
+
onAdd: (source: DetectedDataSource) => void;
|
|
12
|
+
}> = ({ sources, onAdd }) => {
|
|
13
|
+
if (sources.length === 0) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<section
|
|
19
|
+
aria-labelledby="quick-add-data-sources-title"
|
|
20
|
+
className="rounded-md border bg-muted/30 px-3 py-2"
|
|
21
|
+
>
|
|
22
|
+
<div className="flex flex-wrap items-center gap-2">
|
|
23
|
+
<div className="mr-1 flex items-center gap-1.5">
|
|
24
|
+
<SparklesIcon className="h-3.5 w-3.5 text-muted-foreground" />
|
|
25
|
+
<h3 id="quick-add-data-sources-title" className="text-sm font-medium">
|
|
26
|
+
Quick add
|
|
27
|
+
</h3>
|
|
28
|
+
</div>
|
|
29
|
+
<TooltipProvider delayDuration={200}>
|
|
30
|
+
{sources.map((source) => (
|
|
31
|
+
<Tooltip
|
|
32
|
+
key={source.id}
|
|
33
|
+
side="bottom"
|
|
34
|
+
content={<DetectedDataSourceDetails source={source} />}
|
|
35
|
+
>
|
|
36
|
+
<button
|
|
37
|
+
type="button"
|
|
38
|
+
aria-label={`Add ${source.displayName} connection`}
|
|
39
|
+
className="inline-flex items-center gap-1 rounded-full border border-(--blue-8) bg-(--blue-2) px-2.5 py-1 text-xs font-semibold text-(--blue-11) transition-colors hover:bg-(--blue-3) focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2"
|
|
40
|
+
onClick={() => onAdd(source)}
|
|
41
|
+
>
|
|
42
|
+
<PlusIcon className="h-3 w-3" />
|
|
43
|
+
{source.displayName}
|
|
44
|
+
</button>
|
|
45
|
+
</Tooltip>
|
|
46
|
+
))}
|
|
47
|
+
</TooltipProvider>
|
|
48
|
+
</div>
|
|
49
|
+
</section>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const DetectedDataSourceDetails: React.FC<{
|
|
54
|
+
source: DetectedDataSource;
|
|
55
|
+
}> = ({ source }) => (
|
|
56
|
+
<div className="min-w-64 space-y-2 py-1">
|
|
57
|
+
<div>
|
|
58
|
+
<div className="font-medium">{source.displayName}</div>
|
|
59
|
+
<div className="text-xs text-muted-foreground">
|
|
60
|
+
Detected from{" "}
|
|
61
|
+
{source.origins.map((origin) => origin.label).join(" and ")}
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
<dl className="grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs">
|
|
65
|
+
{source.configuration.map((item) => (
|
|
66
|
+
<div
|
|
67
|
+
className="contents"
|
|
68
|
+
key={
|
|
69
|
+
item.value.kind === "environment-variable"
|
|
70
|
+
? item.value.name
|
|
71
|
+
: `${item.field}:${item.value.value}`
|
|
72
|
+
}
|
|
73
|
+
>
|
|
74
|
+
<dt className="text-muted-foreground">{item.field}</dt>
|
|
75
|
+
<dd>
|
|
76
|
+
<code>
|
|
77
|
+
{item.value.kind === "environment-variable"
|
|
78
|
+
? `os.environ["${item.value.name}"]`
|
|
79
|
+
: item.value.value}
|
|
80
|
+
</code>
|
|
81
|
+
</dd>
|
|
82
|
+
</div>
|
|
83
|
+
))}
|
|
84
|
+
</dl>
|
|
85
|
+
<div className="text-xs text-muted-foreground">
|
|
86
|
+
Click to add a configured cell.
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
export const AutoDiscoveredDataSources: React.FC<{
|
|
92
|
+
onSubmit: () => void;
|
|
93
|
+
}> = ({ onSubmit }) => {
|
|
94
|
+
const insertCode = useInsertCode();
|
|
95
|
+
const { data } = useDataSourceDiscovery();
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<QuickAddDataSources
|
|
99
|
+
sources={data ?? []}
|
|
100
|
+
onAdd={(source) => {
|
|
101
|
+
insertCode(source.code);
|
|
102
|
+
onSubmit();
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
@@ -53,9 +53,11 @@ export const ViewerBanner = () => {
|
|
|
53
53
|
|
|
54
54
|
// A zero-height sticky row pins the banner to the top-left of the notebook
|
|
55
55
|
// scroll area, so it stays visible while scrolling without reserving space in
|
|
56
|
-
// the flow.
|
|
56
|
+
// the flow. Because it reserves no space, the banner visually overlaps the
|
|
57
|
+
// app header (sticky at z-50); setting the banner to z-100 keeps the header
|
|
58
|
+
// from covering the button and swallowing its clicks.
|
|
57
59
|
return (
|
|
58
|
-
<div className="sticky top-2 left-2 z-
|
|
60
|
+
<div className="sticky top-2 left-2 z-100 h-0 ml-2 w-fit print:hidden">
|
|
59
61
|
<Banner
|
|
60
62
|
kind="info"
|
|
61
63
|
className="flex items-center gap-2 rounded px-2 py-1 text-xs shadow-sm"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import type {
|
|
3
|
+
DataSourceDiscoveryResult,
|
|
3
4
|
SQLSchemaListPreview,
|
|
4
5
|
SQLTableListPreview,
|
|
5
6
|
SQLTablePreview,
|
|
@@ -19,6 +20,16 @@ import type {
|
|
|
19
20
|
// The backend returns data tables, which could also exist in other engines, dbs, schemas
|
|
20
21
|
// Thus, we use the request ID pattern to match the response to the request
|
|
21
22
|
|
|
23
|
+
export const DiscoverDataSources = new DeferredRequestRegistry<
|
|
24
|
+
{},
|
|
25
|
+
DataSourceDiscoveryResult
|
|
26
|
+
>("data-source-discovery-result", async (requestId) => {
|
|
27
|
+
const client = getRequestClient();
|
|
28
|
+
await client.discoverDataSources({
|
|
29
|
+
requestId,
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
22
33
|
export const PreviewSQLTable = new DeferredRequestRegistry<
|
|
23
34
|
Omit<PreviewSQLTableRequest, "requestId">,
|
|
24
35
|
SQLTablePreview
|
|
@@ -341,6 +341,7 @@ export class IslandsPyodideBridge implements RunRequests, EditRequests {
|
|
|
341
341
|
previewSQLTableList = throwNotImplemented;
|
|
342
342
|
previewSQLSchemaList = throwNotImplemented;
|
|
343
343
|
previewDataSourceConnection = throwNotImplemented;
|
|
344
|
+
discoverDataSources = throwNotImplemented;
|
|
344
345
|
validateSQL = throwNotImplemented;
|
|
345
346
|
openFile = throwNotImplemented;
|
|
346
347
|
sendListFiles = throwNotImplemented;
|
|
@@ -44,6 +44,8 @@ export type SQLTableListPreview =
|
|
|
44
44
|
export type SQLSchemaListPreview =
|
|
45
45
|
NotificationMessageData<"sql-schema-list-preview">;
|
|
46
46
|
export type ValidateSQLResult = NotificationMessageData<"validate-sql-result">;
|
|
47
|
+
export type DataSourceDiscoveryResult =
|
|
48
|
+
NotificationMessageData<"data-source-discovery-result">;
|
|
47
49
|
export type SecretKeysResult = NotificationMessageData<"secret-keys-result">;
|
|
48
50
|
export type StartupLogs = NotificationMessageData<"startup-logs">;
|
|
49
51
|
export type CellMessage = NotificationMessageData<"cell-op">;
|
|
@@ -114,6 +114,21 @@ describe("createLazyRequests", () => {
|
|
|
114
114
|
expect(mockInit).toHaveBeenCalledTimes(1);
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
+
it("starts the kernel for datasource discovery", async () => {
|
|
118
|
+
mockDelegate.discoverDataSources = vi.fn().mockResolvedValue(null);
|
|
119
|
+
const lazyRequests = createLazyRequests(
|
|
120
|
+
mockDelegate,
|
|
121
|
+
mockGetRuntimeManager,
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
await lazyRequests.discoverDataSources({
|
|
125
|
+
requestId: requestId("discovery"),
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
expect(mockInit).toHaveBeenCalledOnce();
|
|
129
|
+
expect(mockDelegate.discoverDataSources).toHaveBeenCalledOnce();
|
|
130
|
+
});
|
|
131
|
+
|
|
117
132
|
it("should only call init once across multiple requests", async () => {
|
|
118
133
|
const lazyRequests = createLazyRequests(
|
|
119
134
|
mockDelegate,
|
|
@@ -130,6 +130,20 @@ describe("createNetworkRequests", () => {
|
|
|
130
130
|
expect(mockClient.GET).toHaveBeenCalledWith("/api/export/availability");
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
+
it("discoverDataSources should POST to the discovery endpoint", async () => {
|
|
134
|
+
const requests = createNetworkRequests();
|
|
135
|
+
const request = { requestId: "discovery-request" } as any;
|
|
136
|
+
await requests.discoverDataSources(request);
|
|
137
|
+
|
|
138
|
+
expect(mockClient.POST).toHaveBeenCalledWith(
|
|
139
|
+
"/api/datasources/discover",
|
|
140
|
+
expect.objectContaining({
|
|
141
|
+
body: request,
|
|
142
|
+
params: expect.anything(),
|
|
143
|
+
}),
|
|
144
|
+
);
|
|
145
|
+
});
|
|
146
|
+
|
|
133
147
|
it("getPackageList should not require a kernel connection", async () => {
|
|
134
148
|
const { waitForConnectionOpen, waitForConnectionOpenIfNotebook } =
|
|
135
149
|
await import("../connection");
|
|
@@ -51,6 +51,7 @@ const ACTIONS: Record<keyof AllRequests, Action> = {
|
|
|
51
51
|
sendRunScratchpad: "startConnection",
|
|
52
52
|
saveAppConfig: "startConnection",
|
|
53
53
|
saveCellConfig: "startConnection",
|
|
54
|
+
discoverDataSources: "startConnection",
|
|
54
55
|
|
|
55
56
|
// Export operations start a connection
|
|
56
57
|
exportAsHTML: "startConnection",
|
|
@@ -267,6 +267,14 @@ export function createNetworkRequests(): EditRequests & RunRequests {
|
|
|
267
267
|
})
|
|
268
268
|
.then(handleResponseReturnNull);
|
|
269
269
|
},
|
|
270
|
+
discoverDataSources: (request) => {
|
|
271
|
+
return getClient()
|
|
272
|
+
.POST("/api/datasources/discover", {
|
|
273
|
+
body: request,
|
|
274
|
+
params: getParams(),
|
|
275
|
+
})
|
|
276
|
+
.then(handleResponseReturnNull);
|
|
277
|
+
},
|
|
270
278
|
validateSQL: (request) => {
|
|
271
279
|
return getClient()
|
|
272
280
|
.POST("/api/sql/validate", {
|
|
@@ -62,6 +62,7 @@ export function createStaticRequests(): EditRequests & RunRequests {
|
|
|
62
62
|
previewSQLTableList: throwNotInEditMode,
|
|
63
63
|
previewSQLSchemaList: throwNotInEditMode,
|
|
64
64
|
previewDataSourceConnection: throwNotInEditMode,
|
|
65
|
+
discoverDataSources: throwNotInEditMode,
|
|
65
66
|
validateSQL: throwNotInEditMode,
|
|
66
67
|
openFile: throwNotInEditMode,
|
|
67
68
|
getUsageStats: throwNotInEditMode,
|
|
@@ -43,6 +43,7 @@ export function createErrorToastingRequests(
|
|
|
43
43
|
previewSQLTableList: "Failed to fetch SQL table list",
|
|
44
44
|
previewSQLSchemaList: "Failed to fetch SQL schema list",
|
|
45
45
|
previewDataSourceConnection: "Failed to preview data source connection",
|
|
46
|
+
discoverDataSources: "Failed to discover data sources",
|
|
46
47
|
validateSQL: "Failed to validate SQL",
|
|
47
48
|
openFile: "Failed to open file",
|
|
48
49
|
getUsageStats: "", // No toast
|
|
@@ -75,6 +75,7 @@ export type ListSQLTablesRequest = schemas["ListSQLTablesRequest"];
|
|
|
75
75
|
export type ListSQLSchemasRequest = schemas["ListSQLSchemasRequest"];
|
|
76
76
|
export type ListDataSourceConnectionRequest =
|
|
77
77
|
schemas["ListDataSourceConnectionRequest"];
|
|
78
|
+
export type DiscoverDataSourcesRequest = schemas["DiscoverDataSourcesRequest"];
|
|
78
79
|
export type ValidateSQLRequest = schemas["ValidateSQLRequest"];
|
|
79
80
|
export type DebugCellRequest = schemas["DebugCellRequest"];
|
|
80
81
|
export type SetBreakpointsRequest = schemas["SetBreakpointsRequest"];
|
|
@@ -181,6 +182,7 @@ export interface EditRequests {
|
|
|
181
182
|
previewDataSourceConnection: (
|
|
182
183
|
request: ListDataSourceConnectionRequest,
|
|
183
184
|
) => Promise<null>;
|
|
185
|
+
discoverDataSources: (request: DiscoverDataSourcesRequest) => Promise<null>;
|
|
184
186
|
validateSQL: (request: ValidateSQLRequest) => Promise<null>;
|
|
185
187
|
openFile: (request: { path: string; lineNumber?: number }) => Promise<null>;
|
|
186
188
|
getUsageStats: () => Promise<UsageResponse>;
|
package/src/core/wasm/bridge.ts
CHANGED
|
@@ -630,6 +630,16 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
630
630
|
return null;
|
|
631
631
|
};
|
|
632
632
|
|
|
633
|
+
discoverDataSources: EditRequests["discoverDataSources"] = async (
|
|
634
|
+
request,
|
|
635
|
+
) => {
|
|
636
|
+
await this.putControlRequest({
|
|
637
|
+
type: "discover-data-sources",
|
|
638
|
+
...request,
|
|
639
|
+
});
|
|
640
|
+
return null;
|
|
641
|
+
};
|
|
642
|
+
|
|
633
643
|
getUsageStats = throwNotImplemented;
|
|
634
644
|
getEnvironmentInfo: EditRequests["getEnvironmentInfo"] = async () => {
|
|
635
645
|
const response = await this.rpc.proxy.request.bridge({
|
|
@@ -42,6 +42,7 @@ import { connectionTransportTypeAtom, useSetAppConfig } from "../config/config";
|
|
|
42
42
|
import { useDataSourceActions } from "../datasets/data-source-connections";
|
|
43
43
|
import type { ConnectionName } from "../datasets/engines";
|
|
44
44
|
import {
|
|
45
|
+
DiscoverDataSources,
|
|
45
46
|
PreviewSQLSchemaList,
|
|
46
47
|
PreviewSQLTable,
|
|
47
48
|
PreviewSQLTableList,
|
|
@@ -394,6 +395,9 @@ export function useMarimoKernelConnection(opts: {
|
|
|
394
395
|
case "validate-sql-result":
|
|
395
396
|
ValidateSQL.resolve(msg.data.request_id as RequestId, msg.data);
|
|
396
397
|
return;
|
|
398
|
+
case "data-source-discovery-result":
|
|
399
|
+
DiscoverDataSources.resolve(msg.data.request_id as RequestId, msg.data);
|
|
400
|
+
return;
|
|
397
401
|
case "secret-keys-result":
|
|
398
402
|
SECRETS_REGISTRY.resolve(msg.data.request_id, msg.data);
|
|
399
403
|
return;
|