@marimo-team/frontend 0.25.3-dev134 → 0.25.3-dev135
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-DC6FFQOg.js → CellStatus-Bu_cFOaf.js} +1 -1
- package/dist/assets/{ErrorBoundary-Ce-Ujlwj.js → ErrorBoundary-Cy4lxM4U.js} +2 -2
- package/dist/assets/{JsonOutput-CfEBzaqW.js → JsonOutput-Dnd0uzN4.js} +5 -5
- package/dist/assets/{MarimoErrorOutput-Bh6o9zle.js → MarimoErrorOutput-DWgmERpO.js} +4 -4
- package/dist/assets/{RenderHTML-COGZsXQV.js → RenderHTML-BuZ8DdVv.js} +2 -2
- package/dist/assets/{RunButton-DQ51plUv.js → RunButton-BXXDV5w-.js} +1 -1
- package/dist/assets/{add-cell-with-ai-D7gtGUsg.js → add-cell-with-ai-DYahRMb_.js} +26 -26
- package/dist/assets/{add-connection-dialog-CpMCc97S.js → add-connection-dialog-CjRaQbDW.js} +51 -51
- package/dist/assets/{agent-panel-BSFYqJ9B.js → agent-panel-Cb9PZdDM.js} +3 -3
- package/dist/assets/ai-model-dropdown-Bbr2oylS.js +13 -0
- package/dist/assets/{app-config-button-Cfcg_5Bz.js → app-config-button-CPNc_---.js} +1 -1
- package/dist/assets/{blob-CszMu60N.js → blob-CQAkRxR1.js} +1 -1
- package/dist/assets/cell-editor-CjvWSYDB.js +42 -0
- package/dist/assets/{cell-link-Cj0gGaMV.js → cell-link-DIOanEQB.js} +1 -1
- package/dist/assets/{cells-SvbLY10y.js → cells-lwP9-xsQ.js} +41 -41
- package/dist/assets/{chat-display-D43_g3TX.js → chat-display-DpCQoui-.js} +1 -1
- package/dist/assets/{chat-panel-B_HAJMwx.js → chat-panel-C79_pWxF.js} +2 -2
- package/dist/assets/{chat-ui-BEcYCphu.js → chat-ui-DOOiaOcb.js} +1 -1
- package/dist/assets/{column-preview-CrzaJKk8.js → column-preview-DIvrCqra.js} +1 -1
- package/dist/assets/{command-palette-Bm9yIVcD.js → command-palette-BYgBVslq.js} +1 -1
- package/dist/assets/{common-BJyUxCzv.js → common-B7U2CeDc.js} +1 -1
- package/dist/assets/{components-D1f_Cz4i.js → components-Vz1pD133.js} +1 -1
- package/dist/assets/{datasource-C8KSVfSD.js → datasource-Bp8TnG7a.js} +2 -2
- package/dist/assets/{dependency-graph-panel-BhmyJbUl.js → dependency-graph-panel-B31-YcSF.js} +3 -3
- package/dist/assets/{documentation-panel-DcVG0Q0d.js → documentation-panel-C2MJwSef.js} +1 -1
- package/dist/assets/{download-Bx52VRE4.js → download-J6sWXUJR.js} +1 -1
- package/dist/assets/{edit-page-DUrwOHR-.js → edit-page-DfxHDnWP.js} +6 -6
- package/dist/assets/{error-entries-11OuHzUF.js → error-entries-BcRbOxwK.js} +1 -1
- package/dist/assets/{error-panel-XJy5S25F.js → error-panel-jZlFCjdy.js} +1 -1
- package/dist/assets/feedback-button-94vZrmBy.js +1 -0
- package/dist/assets/{feedback-button-B7jh_B4w.js → feedback-button-C2XmZw_y.js} +2 -2
- package/dist/assets/{file-explorer-panel-CnVxbF4A.js → file-explorer-panel-Cg9UovsS.js} +1 -1
- package/dist/assets/{file-name-input-BJuqjQqH.js → file-name-input-y9ggAMGJ.js} +1 -1
- package/dist/assets/{floating-outline-8yyZ-MOJ.js → floating-outline-CE1olGl0.js} +1 -1
- package/dist/assets/{gallery-page-DJvGHePf.js → gallery-page-ClEnoAT-.js} +1 -1
- package/dist/assets/{glide-data-editor-Cyc8DHZx.js → glide-data-editor-Cp0q28Zz.js} +1 -1
- package/dist/assets/{home-page-tRZJmSU6.js → home-page-DJsI6Od_.js} +1 -1
- package/dist/assets/{hooks-CxGwybGw.js → hooks-DGSryuSD.js} +1 -1
- package/dist/assets/{index-CoxbqhGH.js → index-BjNf54kO.js} +7 -7
- package/dist/assets/{layout-DvXJxBiL.js → layout-DRVIFud8.js} +5 -5
- package/dist/assets/{logs-panel-KtsY7TrR.js → logs-panel-Db38azhc.js} +1 -1
- package/dist/assets/{markdown-renderer-DUgV7_fm.js → markdown-renderer-D2td9eFc.js} +1 -1
- package/dist/assets/{name-cell-input-C3-Cj-Ek.js → name-cell-input-CJpi0Kvu.js} +1 -1
- package/dist/assets/{outline-panel-BzyY4JA6.js → outline-panel-DxQKP4eN.js} +1 -1
- package/dist/assets/{packages-panel-DxosbWko.js → packages-panel-BFzN4mNb.js} +1 -1
- package/dist/assets/{panel-accordion-state-BRbTib2B.js → panel-accordion-state-D3RiRniG.js} +1 -1
- package/dist/assets/panels-CpUpLOy4.js +1 -0
- package/dist/assets/{process-output-CSwx7rvo.js → process-output-B6v1FE29.js} +1 -1
- package/dist/assets/{readonly-code-display-B9y9423Y.js → readonly-code-display-Deg2hzFh.js} +1 -1
- package/dist/assets/{readonly-python-code-Dgw6trlk.js → readonly-python-code-DPGknu49.js} +1 -1
- package/dist/assets/{reveal-component-B9A4wkG-.js → reveal-component-CXkDpGxy.js} +2 -2
- package/dist/assets/{run-page-C1MQ5b_A.js → run-page-qp2KKYgs.js} +1 -1
- package/dist/assets/{runtime-details-state-D_hOQL9T.js → runtime-details-state-BiGF299n.js} +1 -1
- package/dist/assets/{scratchpad-panel-CBCsPmMW.js → scratchpad-panel-QV0lacAe.js} +1 -1
- package/dist/assets/session-panel-CrWluawa.js +1 -0
- package/dist/assets/{snippets-panel-C0VDE_4i.js → snippets-panel-CM7g9b6c.js} +1 -1
- package/dist/assets/{state-DrraMmqz.js → state-DhMztz1E.js} +1 -1
- package/dist/assets/{state-DvU2AiFx.js → state-lEPoZS4k.js} +4 -4
- package/dist/assets/{tracing-C5d51Nmi.js → tracing-DRA8maZB.js} +1 -1
- package/dist/assets/{tracing-panel-B89R8dWE.js → tracing-panel-DLxPRadV.js} +2 -2
- package/dist/assets/{tree-actions-Cph8FVzh.js → tree-actions-COtU5qy_.js} +1 -1
- package/dist/assets/{useAddCell-VPkB72pn.js → useAddCell-BAEOA87M.js} +1 -1
- package/dist/assets/{useCellActionButton--zI3GFnt.js → useCellActionButton-BobjsJfu.js} +1 -1
- package/dist/assets/{useDeleteCell-CjewKeSr.js → useDeleteCell-gedazkBF.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-Bt_ka-wl.js → useDependencyPanelTab-DAJ6BOUm.js} +1 -1
- package/dist/assets/useNotebookActions-CnLArLoz.js +1 -0
- package/dist/assets/{useRunCells-BupCZpzk.js → useRunCells-CUknep7p.js} +1 -1
- package/dist/assets/{useSplitCell-CaLIR0TS.js → useSplitCell-DeXniINv.js} +1 -1
- package/dist/index.html +20 -20
- package/package.json +1 -1
- package/src/components/datasources/__tests__/column-preview.test.tsx +35 -3
- package/src/components/datasources/__tests__/datasources-interactions.test.tsx +181 -0
- package/src/components/datasources/__tests__/utils.test.ts +57 -6
- package/src/components/datasources/column-preview.tsx +5 -2
- package/src/components/datasources/datasources.tsx +3 -4
- package/src/components/datasources/utils.ts +32 -23
- package/dist/assets/ai-model-dropdown-D575Vid8.js +0 -13
- package/dist/assets/cell-editor-BLpOlLnM.js +0 -42
- package/dist/assets/feedback-button-C-eKtxXE.js +0 -1
- package/dist/assets/panels-Da3071Q4.js +0 -1
- package/dist/assets/session-panel-CiHCKPlx.js +0 -1
- package/dist/assets/useNotebookActions-DV2S6KaG.js +0 -1
|
@@ -78,6 +78,7 @@ import {
|
|
|
78
78
|
areChildSchemasResolved,
|
|
79
79
|
areSchemasResolved,
|
|
80
80
|
areTablesResolved,
|
|
81
|
+
fullyQualifiedTableName,
|
|
81
82
|
isSchemaless,
|
|
82
83
|
schemaSubtreeMatchesSearch,
|
|
83
84
|
shouldExpandDatabaseForSearch,
|
|
@@ -637,7 +638,7 @@ const SchemaNode: React.FC<SchemaNodeProps> = (props) => {
|
|
|
637
638
|
const [prevSearchValue, setPrevSearchValue] = React.useState(searchValue);
|
|
638
639
|
const [prevExpandForSearch, setPrevExpandForSearch] =
|
|
639
640
|
React.useState(expandForSearch);
|
|
640
|
-
const uniqueValue =
|
|
641
|
+
const uniqueValue = JSON.stringify(["schema", databaseName, ...schemaPath]);
|
|
641
642
|
const childSchemas = schema.child_schemas ?? [];
|
|
642
643
|
|
|
643
644
|
// Re-sync when the query changes or when newly resolved data turns this
|
|
@@ -1095,9 +1096,7 @@ const DatasetColumnItem: React.FC<{
|
|
|
1095
1096
|
column={column}
|
|
1096
1097
|
onAddColumnChart={handleAddColumn}
|
|
1097
1098
|
preview={columnsPreviews.get(
|
|
1098
|
-
sqlTableContext
|
|
1099
|
-
? `${sqlTableContext.database}.${sqlTableContext.schema}.${table.name}:${column.name}`
|
|
1100
|
-
: `${table.name}:${column.name}`,
|
|
1099
|
+
`${fullyQualifiedTableName(sqlTableContext, table.name)}:${column.name}`,
|
|
1101
1100
|
)}
|
|
1102
1101
|
sqlTableContext={sqlTableContext}
|
|
1103
1102
|
/>
|
|
@@ -13,26 +13,29 @@ import type {
|
|
|
13
13
|
import { logNever } from "@/utils/assertNever";
|
|
14
14
|
import type { ColumnHeaderStatsKey } from "../data-table/types";
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
function tablePath(context: SQLTableContext, tableName: string): string[] {
|
|
17
|
+
const segments = context.schemaPath?.length
|
|
18
|
+
? context.schemaPath
|
|
19
|
+
: [context.schema];
|
|
20
|
+
return [context.database, ...segments.filter(Boolean), tableName];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
23
|
export function tableUniqueId(
|
|
24
|
-
|
|
24
|
+
context: SQLTableContext | undefined,
|
|
25
25
|
tableName: string,
|
|
26
26
|
): string {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
return context ? JSON.stringify(tablePath(context, tableName)) : tableName;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function fullyQualifiedTableName(
|
|
31
|
+
context: SQLTableContext | undefined,
|
|
32
|
+
tableName: string,
|
|
33
|
+
): string {
|
|
34
|
+
return context
|
|
35
|
+
? getFormatter(context.dialect).formatTablePath(
|
|
36
|
+
tablePath(context, tableName),
|
|
37
|
+
)
|
|
38
|
+
: tableName;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
// Some databases have no schemas, so we don't show it (eg. Clickhouse)
|
|
@@ -114,6 +117,10 @@ const defaultFormatter: SqlCodeFormatter = {
|
|
|
114
117
|
`SELECT ${columnName} FROM ${tableName} LIMIT 100`,
|
|
115
118
|
};
|
|
116
119
|
|
|
120
|
+
function quoteIdentifier(identifier: string): string {
|
|
121
|
+
return `"${identifier.replaceAll('"', '""')}"`;
|
|
122
|
+
}
|
|
123
|
+
|
|
117
124
|
function getFormatter(dialect: string): SqlCodeFormatter {
|
|
118
125
|
dialect = dialect.toLowerCase();
|
|
119
126
|
if (!isKnownDialect(dialect)) {
|
|
@@ -146,9 +153,9 @@ function getFormatter(dialect: string): SqlCodeFormatter {
|
|
|
146
153
|
// Quote column and table names to avoid raising errors on weird characters
|
|
147
154
|
return {
|
|
148
155
|
formatTablePath: (tablePath: string[]) =>
|
|
149
|
-
tablePath.map(
|
|
156
|
+
tablePath.map(quoteIdentifier).join("."),
|
|
150
157
|
formatSelectClause: (columnName: string, tableName: string) =>
|
|
151
|
-
`SELECT ${columnName === "*" ? "*" :
|
|
158
|
+
`SELECT ${columnName === "*" ? "*" : quoteIdentifier(columnName)} FROM ${tableName} LIMIT 100`,
|
|
152
159
|
};
|
|
153
160
|
case "db2":
|
|
154
161
|
case "db2i":
|
|
@@ -194,6 +201,7 @@ export function sqlCode({
|
|
|
194
201
|
engine,
|
|
195
202
|
schema,
|
|
196
203
|
defaultSchema,
|
|
204
|
+
schemaPath,
|
|
197
205
|
defaultDatabase,
|
|
198
206
|
database,
|
|
199
207
|
dialect,
|
|
@@ -207,12 +215,13 @@ export function sqlCode({
|
|
|
207
215
|
}
|
|
208
216
|
} else {
|
|
209
217
|
// Include schema if it's not the default schema
|
|
210
|
-
|
|
211
|
-
|
|
218
|
+
const path = schemaPath?.length ? schemaPath : [schema];
|
|
219
|
+
if (path.length > 1 || path[0] !== defaultSchema) {
|
|
220
|
+
tablePath.unshift(...path);
|
|
212
221
|
}
|
|
213
222
|
|
|
214
|
-
//
|
|
215
|
-
if (database !== defaultDatabase) {
|
|
223
|
+
// Nested schema names can also be attached catalog names.
|
|
224
|
+
if (path.length > 1 || database !== defaultDatabase) {
|
|
216
225
|
tablePath.unshift(database);
|
|
217
226
|
}
|
|
218
227
|
}
|