@rebasepro/studio 0.35.1 → 0.37.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.
Files changed (93) hide show
  1. package/README.md +1 -1
  2. package/dist/{ApiExplorer-C61w8gCc.js → ApiExplorer-BVQHAjHB.js} +3 -2
  3. package/dist/{ApiExplorer-C61w8gCc.js.map → ApiExplorer-BVQHAjHB.js.map} +1 -1
  4. package/dist/{useRunAsUsers-CF7tkGzj.js → AuthSimulationSelector-XogpkeXC.js} +4 -68
  5. package/dist/AuthSimulationSelector-XogpkeXC.js.map +1 -0
  6. package/dist/{CronJobsView-DUuyzkJK.js → CronJobsView-DyX9MINh.js} +2 -2
  7. package/dist/{CronJobsView-DUuyzkJK.js.map → CronJobsView-DyX9MINh.js.map} +1 -1
  8. package/dist/DatabaseView-Bi0NZS90.js +1897 -0
  9. package/dist/DatabaseView-Bi0NZS90.js.map +1 -0
  10. package/dist/{JSEditor-Bi2Aol-Y.js → JSEditor-B4Lazm-z.js} +4 -3
  11. package/dist/{JSEditor-Bi2Aol-Y.js.map → JSEditor-B4Lazm-z.js.map} +1 -1
  12. package/dist/RLSEditor-CcHkWFNg.js +973 -0
  13. package/dist/RLSEditor-CcHkWFNg.js.map +1 -0
  14. package/dist/{SQLEditor-DRo5kW1h.js → SQLEditorRoute-f5j_ZKdj.js} +1472 -320
  15. package/dist/SQLEditorRoute-f5j_ZKdj.js.map +1 -0
  16. package/dist/SchemaDiagramView-CckQobIZ.js +98 -0
  17. package/dist/SchemaDiagramView-CckQobIZ.js.map +1 -0
  18. package/dist/{StorageView-D0D8z4lI.js → StorageView-DQEIDFvO.js} +592 -447
  19. package/dist/StorageView-DQEIDFvO.js.map +1 -0
  20. package/dist/TableEditorView-BRZNvD6U.js +3615 -0
  21. package/dist/TableEditorView-BRZNvD6U.js.map +1 -0
  22. package/dist/TablePolicies-C1-tbC8x.js +1740 -0
  23. package/dist/TablePolicies-C1-tbC8x.js.map +1 -0
  24. package/dist/{SchemaVisualizer-Dy4kWKT5.js → TablesDiagram-RTJfwVEN.js} +651 -489
  25. package/dist/TablesDiagram-RTJfwVEN.js.map +1 -0
  26. package/dist/{UsersAndRolesView-CKw4SJPj.js → UsersAndRolesView-Cx6xtMVH.js} +2 -2
  27. package/dist/{UsersAndRolesView-CKw4SJPj.js.map → UsersAndRolesView-Cx6xtMVH.js.map} +1 -1
  28. package/dist/{WebhooksView-CFPY-N9h.js → WebhooksView-Bn9KB7xG.js} +2 -2
  29. package/dist/{WebhooksView-CFPY-N9h.js.map → WebhooksView-Bn9KB7xG.js.map} +1 -1
  30. package/dist/{adminFetch-BfOnfRgU.js → adminFetch-C7Ra8rpP.js} +26 -1
  31. package/dist/{adminFetch-BfOnfRgU.js.map → adminFetch-C7Ra8rpP.js.map} +1 -1
  32. package/dist/components/Database/ActivitySection.d.ts +9 -0
  33. package/dist/components/Database/AdvisorsSection.d.ts +17 -0
  34. package/dist/components/Database/DatabaseView.d.ts +13 -0
  35. package/dist/components/Database/ExtensionsSection.d.ts +2 -0
  36. package/dist/components/Database/FunctionsSection.d.ts +2 -0
  37. package/dist/components/Database/QueriesSection.d.ts +3 -0
  38. package/dist/components/Database/TriggersSection.d.ts +2 -0
  39. package/dist/components/Database/TypesSection.d.ts +2 -0
  40. package/dist/components/Database/format.d.ts +6 -0
  41. package/dist/components/Database/links.d.ts +11 -0
  42. package/dist/components/Database/shared.d.ts +35 -0
  43. package/dist/components/Database/source.d.ts +12 -0
  44. package/dist/components/Database/useCatalogList.d.ts +13 -0
  45. package/dist/components/RLSEditor/RLSEditor.d.ts +2 -0
  46. package/dist/components/RLSEditor/TablePolicies.d.ts +54 -0
  47. package/dist/components/SQLEditor/ExplainVisualizer.d.ts +8 -20
  48. package/dist/components/SQLEditor/ResultChart.d.ts +18 -0
  49. package/dist/components/SQLEditor/SQLEditor.d.ts +13 -1
  50. package/dist/components/SQLEditor/SQLEditorRoute.d.ts +13 -0
  51. package/dist/components/SQLEditor/SQLEditorSidebar.d.ts +7 -1
  52. package/dist/components/SQLEditor/SqlParamsPanel.d.ts +16 -0
  53. package/dist/components/SQLEditor/useSqlSnippets.d.ts +47 -0
  54. package/dist/components/SchemaVisualizer/SchemaDiagramView.d.ts +12 -0
  55. package/dist/components/SchemaVisualizer/TablesDiagram.d.ts +23 -0
  56. package/dist/components/SchemaVisualizer/useSchemaGraph.d.ts +32 -1
  57. package/dist/components/StorageView/StorageView.d.ts +5 -0
  58. package/dist/components/TableEditor/CreateTableDialog.d.ts +8 -0
  59. package/dist/components/TableEditor/DdlConfirm.d.ts +23 -0
  60. package/dist/components/TableEditor/SqlBlock.d.ts +7 -0
  61. package/dist/components/TableEditor/TableDdlSheet.d.ts +9 -0
  62. package/dist/components/TableEditor/TableEditorView.d.ts +7 -0
  63. package/dist/components/TableEditor/tableModel.d.ts +210 -0
  64. package/dist/components/TableEditor/tabs/DataTab.d.ts +12 -0
  65. package/dist/components/TableEditor/tabs/PoliciesTab.d.ts +8 -0
  66. package/dist/components/TableEditor/tabs/RelationsTab.d.ts +8 -0
  67. package/dist/components/TableEditor/tabs/SettingsTab.d.ts +11 -0
  68. package/dist/components/TableEditor/tabs/StatsTab.d.ts +8 -0
  69. package/dist/components/TableEditor/tabs/StructureTab.d.ts +12 -0
  70. package/dist/index.es.js +29 -15
  71. package/dist/index.es.js.map +1 -1
  72. package/dist/{sql_utils-CYcgpgam.js → sql_utils-DkMYltfq.js} +27 -3
  73. package/dist/sql_utils-DkMYltfq.js.map +1 -0
  74. package/dist/useRunAsUsers-GPFCxcBC.js +69 -0
  75. package/dist/useRunAsUsers-GPFCxcBC.js.map +1 -0
  76. package/dist/utils/adminFetch.d.ts +1 -0
  77. package/dist/utils/csv_parse.d.ts +11 -0
  78. package/dist/utils/explain_plan.d.ts +70 -0
  79. package/dist/utils/sql_params.d.ts +51 -0
  80. package/dist/utils/sql_utils.d.ts +16 -0
  81. package/package.json +11 -9
  82. package/dist/RLSEditor-CTG3jLE7.js +0 -2572
  83. package/dist/RLSEditor-CTG3jLE7.js.map +0 -1
  84. package/dist/SQLEditor-DRo5kW1h.js.map +0 -1
  85. package/dist/SchemaVisualizer-Dy4kWKT5.js.map +0 -1
  86. package/dist/StorageView-D0D8z4lI.js.map +0 -1
  87. package/dist/TableEditorView-BKhSBG-K.js +0 -1694
  88. package/dist/TableEditorView-BKhSBG-K.js.map +0 -1
  89. package/dist/components/SchemaVisualizer/SchemaVisualizer.d.ts +0 -3
  90. package/dist/policy-presets-CJKzAvQp.js +0 -167
  91. package/dist/policy-presets-CJKzAvQp.js.map +0 -1
  92. package/dist/sql_utils-CYcgpgam.js.map +0 -1
  93. package/dist/useRunAsUsers-CF7tkGzj.js.map +0 -1
@@ -1,12 +1,369 @@
1
- import { n as SchemaSourceProblemView, r as schemaSourceProblem } from "./schema-source-C4ekB7WU.js";
1
+ import { a as asStringArray, i as asString, n as asNullableString, o as isRecord, r as asNumber, t as asBoolean } from "./adminFetch-C7Ra8rpP.js";
2
2
  import { IconForView, useRebaseContext, useTableDescriptors, useTranslation } from "@rebasepro/app";
3
3
  import { memo, useCallback, useEffect, useMemo, useRef, useState } from "react";
4
- import { Chip, CircularProgress, IconButton, ResizablePanels, SearchBar, ToggleButtonGroup, Tooltip, Typography, cls, defaultBorderMixin, useIsDarkMode } from "@rebasepro/ui";
4
+ import { Chip, CircularProgress, IconButton, Maximize2Icon, RefreshCwIcon, ToggleButtonGroup, Tooltip, Typography, cls, iconSize, useIsDarkMode } from "@rebasepro/ui";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { columnTypeLabel } from "@rebasepro/types";
7
- import { Background, BackgroundVariant, BaseEdge, Controls, EdgeLabelRenderer, Handle, MarkerType, MiniMap, Position, ReactFlow, ReactFlowProvider, applyEdgeChanges, applyNodeChanges, getSmoothStepPath, useReactFlow } from "@xyflow/react";
7
+ import { Background, BackgroundVariant, BaseEdge, Controls, EdgeLabelRenderer, Handle, MarkerType, MiniMap, Position, ReactFlow, ReactFlowProvider, applyEdgeChanges, applyNodeChanges, getSmoothStepPath, useNodesInitialized, useReactFlow } from "@xyflow/react";
8
8
  import "@xyflow/react/dist/style.css";
9
9
  import dagre from "dagre";
10
+ //#region src/components/TableEditor/tableModel.ts
11
+ function tableKey(schema, name) {
12
+ return `${schema}.${name}`;
13
+ }
14
+ function parseColumn(raw) {
15
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
16
+ return {
17
+ name: raw.name,
18
+ key: asString(raw.key, raw.name),
19
+ dataType: asString(raw.dataType, "text"),
20
+ udtName: asString(raw.udtName, "text"),
21
+ nullable: asBoolean(raw.nullable, true),
22
+ defaultExpr: asNullableString(raw.default ?? raw.defaultExpr),
23
+ primaryKey: asBoolean(raw.primaryKey, false),
24
+ unique: asBoolean(raw.unique, false)
25
+ };
26
+ }
27
+ function parsePolicy(raw) {
28
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
29
+ return {
30
+ name: raw.name,
31
+ mode: raw.mode === "restrictive" ? "restrictive" : "permissive",
32
+ operation: asString(raw.operation ?? raw.command, "ALL"),
33
+ roles: asStringArray(raw.roles),
34
+ using: asNullableString(raw.using),
35
+ withCheck: asNullableString(raw.withCheck)
36
+ };
37
+ }
38
+ function parseIndex(raw) {
39
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
40
+ return {
41
+ name: raw.name,
42
+ definition: asString(raw.definition, ""),
43
+ unique: asBoolean(raw.unique, false),
44
+ primary: asBoolean(raw.primary, false)
45
+ };
46
+ }
47
+ function parseForeignKey(raw) {
48
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
49
+ return {
50
+ name: raw.name,
51
+ definition: asString(raw.definition, ""),
52
+ fromSchema: asString(raw.fromSchema, "public"),
53
+ fromTable: asString(raw.fromTable, ""),
54
+ fromColumns: asStringArray(raw.fromColumns),
55
+ toSchema: asString(raw.toSchema, "public"),
56
+ toTable: asString(raw.toTable, ""),
57
+ toColumns: asStringArray(raw.toColumns),
58
+ onDelete: asString(raw.onDelete, "NO ACTION"),
59
+ onUpdate: asString(raw.onUpdate, "NO ACTION")
60
+ };
61
+ }
62
+ function parseMeta(raw) {
63
+ if (!isRecord(raw)) return null;
64
+ const softDeleteColumn = asNullableString(raw.softDeleteColumn ?? raw.soft_delete_column);
65
+ const readonlyColumns = asStringArray(raw.readonlyColumns ?? raw.readonly_columns);
66
+ return {
67
+ slug: asNullableString(raw.slug),
68
+ exposed: asBoolean(raw.exposed, true),
69
+ description: asNullableString(raw.description),
70
+ softDelete: Boolean(softDeleteColumn) || asBoolean(raw.softDelete, false),
71
+ softDeleteColumn,
72
+ history: asBoolean(raw.historyEnabled ?? raw.history_enabled ?? raw.history, false),
73
+ readOnly: readonlyColumns.length > 0 || asBoolean(raw.readOnly, false)
74
+ };
75
+ }
76
+ function listOf(raw, parse) {
77
+ return Array.isArray(raw) ? raw.map(parse).filter((value) => value !== null) : [];
78
+ }
79
+ function parseTable(raw) {
80
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
81
+ const schema = asString(raw.schema, "public");
82
+ const estimate = raw.rowEstimate;
83
+ return {
84
+ schema,
85
+ name: raw.name,
86
+ key: tableKey(schema, raw.name),
87
+ slug: asString(raw.slug, raw.name),
88
+ kind: raw.kind === "view" ? "view" : "table",
89
+ materialized: asBoolean(raw.materialized, false),
90
+ rlsEnabled: asBoolean(raw.rlsEnabled, false),
91
+ rlsForced: asBoolean(raw.rlsForced, false),
92
+ exposed: asBoolean(raw.exposed, true),
93
+ served: asBoolean(raw.served, false),
94
+ comment: asNullableString(raw.comment),
95
+ rowEstimate: typeof estimate === "number" ? estimate : null,
96
+ columns: listOf(raw.columns, parseColumn),
97
+ policies: listOf(raw.policies, parsePolicy),
98
+ indexes: listOf(raw.indexes, parseIndex),
99
+ foreignKeys: listOf(raw.foreignKeys, parseForeignKey),
100
+ meta: parseMeta(raw.meta)
101
+ };
102
+ }
103
+ function parseTablesResponse(raw) {
104
+ if (!isRecord(raw) || !Array.isArray(raw.tables)) return [];
105
+ return listOf(raw.tables, parseTable);
106
+ }
107
+ /** A table's live policies in the shape the RLS editor compares against declarations. */
108
+ function asPostgresPolicies(table) {
109
+ return table.policies.map((policy) => ({
110
+ policyname: policy.name,
111
+ tablename: table.name,
112
+ permissive: policy.mode === "restrictive" ? "RESTRICTIVE" : "PERMISSIVE",
113
+ roles: policy.roles,
114
+ cmd: [
115
+ "SELECT",
116
+ "INSERT",
117
+ "UPDATE",
118
+ "DELETE",
119
+ "ALL"
120
+ ].find((cmd) => cmd === policy.operation.toUpperCase()) ?? "ALL",
121
+ qual: policy.using,
122
+ with_check: policy.withCheck
123
+ }));
124
+ }
125
+ /**
126
+ * Why a table is not on `/api/data`, from what the server reported about it —
127
+ * the one reason that holds. The translation key of the sentence.
128
+ */
129
+ function notServedReasonKey(table) {
130
+ if (!table.rlsEnabled) return "studio_tables_not_served_rls_off";
131
+ if (!(table.meta?.exposed ?? table.exposed)) return "studio_tables_not_served_not_exposed";
132
+ return "studio_tables_not_served_not_picked_up";
133
+ }
134
+ var numberOrNull = (value) => typeof value === "number" && Number.isFinite(value) ? value : null;
135
+ function parseCatalogColumn(raw) {
136
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
137
+ return {
138
+ name: raw.name,
139
+ type: asString(raw.type, "text"),
140
+ udt: asString(raw.udt, "text"),
141
+ category: asString(raw.category, "S"),
142
+ notNull: asBoolean(raw.notNull, false),
143
+ default: asNullableString(raw.default),
144
+ identity: raw.identity === "always" || raw.identity === "by_default" ? raw.identity : null,
145
+ generated: raw.generated === "stored" || raw.generated === "virtual" ? raw.generated : null,
146
+ primaryKey: asBoolean(raw.primaryKey, false),
147
+ comment: asNullableString(raw.comment)
148
+ };
149
+ }
150
+ var CONSTRAINT_KINDS = [
151
+ "primary_key",
152
+ "unique",
153
+ "check",
154
+ "foreign_key",
155
+ "exclusion",
156
+ "other"
157
+ ];
158
+ function parseConstraint(raw) {
159
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
160
+ return {
161
+ name: raw.name,
162
+ kind: CONSTRAINT_KINDS.find((kind) => kind === raw.kind) ?? "other",
163
+ definition: asString(raw.definition, ""),
164
+ columns: asStringArray(raw.columns)
165
+ };
166
+ }
167
+ function parseTrigger(raw) {
168
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
169
+ return {
170
+ name: raw.name,
171
+ enabled: asBoolean(raw.enabled, true),
172
+ definition: asString(raw.definition, ""),
173
+ functionSchema: asString(raw.functionSchema, ""),
174
+ functionName: asString(raw.functionName, "")
175
+ };
176
+ }
177
+ function parseGrant(raw) {
178
+ if (!isRecord(raw) || typeof raw.grantee !== "string") return null;
179
+ return {
180
+ grantee: raw.grantee,
181
+ grantor: asString(raw.grantor, ""),
182
+ privilege: asString(raw.privilege, ""),
183
+ grantable: asBoolean(raw.grantable, false)
184
+ };
185
+ }
186
+ function parseCatalogIndex(raw) {
187
+ if (!isRecord(raw) || typeof raw.name !== "string") return null;
188
+ return {
189
+ name: raw.name,
190
+ definition: asString(raw.definition, ""),
191
+ method: asString(raw.method, "btree"),
192
+ unique: asBoolean(raw.unique, false),
193
+ primary: asBoolean(raw.primary, false),
194
+ valid: asBoolean(raw.valid, true),
195
+ backsConstraint: asBoolean(raw.backsConstraint, false),
196
+ bytes: numberOrNull(raw.bytes),
197
+ scans: numberOrNull(raw.scans),
198
+ tuplesRead: numberOrNull(raw.tuplesRead),
199
+ tuplesFetched: numberOrNull(raw.tuplesFetched)
200
+ };
201
+ }
202
+ function parseStats(raw) {
203
+ if (!isRecord(raw)) return null;
204
+ const n = (key) => numberOrNull(raw[key]);
205
+ const s = (key) => asNullableString(raw[key]);
206
+ return {
207
+ totalBytes: n("totalBytes"),
208
+ tableBytes: n("tableBytes"),
209
+ indexBytes: n("indexBytes"),
210
+ toastBytes: n("toastBytes"),
211
+ rowEstimate: n("rowEstimate"),
212
+ liveTuples: n("liveTuples"),
213
+ deadTuples: n("deadTuples"),
214
+ seqScans: n("seqScans"),
215
+ seqTuplesRead: n("seqTuplesRead"),
216
+ indexScans: n("indexScans"),
217
+ indexTuplesFetched: n("indexTuplesFetched"),
218
+ inserts: n("inserts"),
219
+ updates: n("updates"),
220
+ deletes: n("deletes"),
221
+ lastVacuum: s("lastVacuum"),
222
+ lastAutovacuum: s("lastAutovacuum"),
223
+ lastAnalyze: s("lastAnalyze"),
224
+ lastAutoanalyze: s("lastAutoanalyze")
225
+ };
226
+ }
227
+ var RELATION_KINDS = [
228
+ "table",
229
+ "partitioned_table",
230
+ "view",
231
+ "materialized_view",
232
+ "foreign_table"
233
+ ];
234
+ function parseTableDetails(raw) {
235
+ if (!isRecord(raw) || !isRecord(raw.relation)) return null;
236
+ const relation = raw.relation;
237
+ const fks = isRecord(raw.foreignKeys) ? raw.foreignKeys : {};
238
+ return {
239
+ relation: {
240
+ schema: asString(relation.schema, "public"),
241
+ name: asString(relation.name, ""),
242
+ kind: RELATION_KINDS.find((kind) => kind === relation.kind) ?? "table",
243
+ owner: asString(relation.owner, ""),
244
+ rlsEnabled: asBoolean(relation.rlsEnabled, false),
245
+ rlsForced: asBoolean(relation.rlsForced, false),
246
+ comment: asNullableString(relation.comment),
247
+ defaultPrivileges: asBoolean(relation.defaultPrivileges, false)
248
+ },
249
+ columns: listOf(raw.columns, parseCatalogColumn),
250
+ constraints: listOf(raw.constraints, parseConstraint),
251
+ foreignKeys: {
252
+ outgoing: listOf(fks.outgoing, parseForeignKey),
253
+ incoming: listOf(fks.incoming, parseForeignKey)
254
+ },
255
+ triggers: listOf(raw.triggers, parseTrigger),
256
+ grants: listOf(raw.grants, parseGrant),
257
+ indexes: listOf(raw.indexes, parseCatalogIndex),
258
+ stats: parseStats(raw.stats),
259
+ ddl: asString(raw.ddl, "")
260
+ };
261
+ }
262
+ function parseRowsPage(raw) {
263
+ const record = isRecord(raw) ? raw : {};
264
+ const count = isRecord(record.count) ? record.count : {};
265
+ const rows = Array.isArray(record.rows) ? record.rows.filter(isRecord).map((row) => {
266
+ const out = {};
267
+ for (const [key, value] of Object.entries(row)) out[key] = value === null || value === void 0 ? null : String(value);
268
+ return out;
269
+ }) : [];
270
+ const reason = record.readOnlyReason;
271
+ return {
272
+ columns: listOf(record.columns, parseCatalogColumn),
273
+ rows,
274
+ count: {
275
+ value: asNumber(count.value, rows.length),
276
+ exact: asBoolean(count.exact, true)
277
+ },
278
+ primaryKey: asStringArray(record.primaryKey),
279
+ readOnly: asBoolean(record.readOnly, false),
280
+ readOnlyReason: reason === "view" || reason === "no_primary_key" ? reason : null
281
+ };
282
+ }
283
+ /** `?table=schema.name` — the selected table. */
284
+ var TABLE_PARAM = "table";
285
+ /** `?tableTab=policies` — the inspector tab (the hosted console owns `?tab=`). */
286
+ var TABLE_TAB_PARAM = "tableTab";
287
+ /** `?tablesView=diagram` — the schema diagram instead of a table. */
288
+ var TABLES_VIEW_PARAM = "tablesView";
289
+ /** `?tableFilter=[...]` — the Data tab's filters, as JSON. */
290
+ var TABLE_FILTER_PARAM = "tableFilter";
291
+ var INSPECTOR_TABS = [
292
+ "data",
293
+ "structure",
294
+ "policies",
295
+ "relations",
296
+ "stats",
297
+ "settings"
298
+ ];
299
+ function isInspectorTab(value) {
300
+ return INSPECTOR_TABS.some((tab) => tab === value);
301
+ }
302
+ /** Opens a table in the Tables view, optionally on one tab and with Data filters. */
303
+ function tablesLink(key, tab, filters) {
304
+ const params = new URLSearchParams({ [TABLE_PARAM]: key });
305
+ if (tab) params.set(TABLE_TAB_PARAM, tab);
306
+ if (filters && filters.length > 0) params.set(TABLE_FILTER_PARAM, JSON.stringify(filters));
307
+ return `/tables?${params.toString()}`;
308
+ }
309
+ /** Opens the SQL editor with `sql` in a new tab. */
310
+ function sqlDraftLink(sql) {
311
+ return `/sql?sqlDraft=${encodeURIComponent(sql)}`;
312
+ }
313
+ var ROW_FILTER_OPERATORS = [
314
+ "eq",
315
+ "neq",
316
+ "lt",
317
+ "lte",
318
+ "gt",
319
+ "gte",
320
+ "like",
321
+ "ilike",
322
+ "in",
323
+ "is_null",
324
+ "not_null"
325
+ ];
326
+ function parseFilterParam(raw) {
327
+ if (!raw) return [];
328
+ try {
329
+ const parsed = JSON.parse(raw);
330
+ if (!Array.isArray(parsed)) return [];
331
+ return parsed.filter(isRecord).flatMap((entry) => {
332
+ const op = ROW_FILTER_OPERATORS.find((candidate) => candidate === entry.op);
333
+ if (typeof entry.column !== "string" || !op) return [];
334
+ const value = Array.isArray(entry.value) ? entry.value.map((item) => String(item)) : entry.value === void 0 || entry.value === null ? void 0 : String(entry.value);
335
+ return [{
336
+ column: entry.column,
337
+ op,
338
+ ...value !== void 0 ? { value } : {}
339
+ }];
340
+ });
341
+ } catch {
342
+ return [];
343
+ }
344
+ }
345
+ /** Bytes as a reader says them: 1.2 MB, 830 kB. */
346
+ function formatBytes(bytes) {
347
+ if (bytes === null) return "—";
348
+ if (bytes < 1024) return `${bytes} B`;
349
+ const units = [
350
+ "kB",
351
+ "MB",
352
+ "GB",
353
+ "TB"
354
+ ];
355
+ let value = bytes / 1024;
356
+ let unit = 0;
357
+ while (value >= 1024 && unit < units.length - 1) {
358
+ value /= 1024;
359
+ unit++;
360
+ }
361
+ return `${value >= 100 ? value.toFixed(0) : value.toFixed(1)} ${units[unit]}`;
362
+ }
363
+ function formatCount(value, locale) {
364
+ return value === null ? "—" : new Intl.NumberFormat(locale).format(value);
365
+ }
366
+ //#endregion
10
367
  //#region src/components/SchemaVisualizer/dagre-layout.ts
11
368
  /**
12
369
  * Place the graph with dagre, top to bottom.
@@ -263,7 +620,10 @@ function keyTypeLabel(table) {
263
620
  if (!key) return "FK";
264
621
  return columnTypeLabel(SERIAL_REFERENCE[key.type.kind] ?? key.type);
265
622
  }
266
- var buildGraph = (tables, liveRls) => {
623
+ function isJunctionNode(node) {
624
+ return Boolean(node.data.isJunction);
625
+ }
626
+ var buildGraph = (tables, liveRls, catalog = []) => {
267
627
  /**
268
628
  * Is RLS on for this table?
269
629
  *
@@ -432,6 +792,78 @@ var buildGraph = (tables, liveRls) => {
432
792
  }
433
793
  });
434
794
  }
795
+ const junctionTables = new Set(nodes.filter(isJunctionNode).map((node) => node.data.tableName));
796
+ for (const table of catalog) {
797
+ if (table.kind !== "table") continue;
798
+ const nodeId = `table-${table.name}`;
799
+ if (nodeColumns.has(nodeId) || junctionTables.has(table.name)) continue;
800
+ const fkColumns = new Set(table.foreignKeys.flatMap((fk) => fk.fromColumns));
801
+ const columns = table.columns.map((column) => ({
802
+ name: column.name,
803
+ key: column.name,
804
+ type: column.dataType,
805
+ typeLabel: column.dataType,
806
+ isPrimaryKey: column.primaryKey,
807
+ isForeignKey: fkColumns.has(column.name),
808
+ isRequired: !column.nullable,
809
+ isUnique: column.unique,
810
+ isEnum: false
811
+ }));
812
+ nodeColumns.set(nodeId, columns);
813
+ nodes.push({
814
+ id: nodeId,
815
+ type: "tableNode",
816
+ position: {
817
+ x: 0,
818
+ y: 0
819
+ },
820
+ data: {
821
+ tableName: table.name,
822
+ collectionName: table.name,
823
+ slug: table.name,
824
+ columns,
825
+ isJunction: false,
826
+ isUnmanaged: true,
827
+ rlsEnabled: isRlsEnabled(table.schema, table.name, table.rlsEnabled),
828
+ historyEnabled: false
829
+ }
830
+ });
831
+ }
832
+ const drawnEdge = new Set(edges.map((edge) => `${edge.source}|${edge.sourceHandle}|${edge.target}`));
833
+ for (const table of catalog) {
834
+ if (table.kind !== "table" || junctionTables.has(table.name)) continue;
835
+ const sourceNodeId = `table-${table.name}`;
836
+ if (!nodeColumns.has(sourceNodeId)) continue;
837
+ for (const fk of table.foreignKeys) {
838
+ const targetNodeId = junctionTables.has(fk.toTable) ? `junction-${fk.toTable}` : `table-${fk.toTable}`;
839
+ if (!nodeColumns.has(targetNodeId)) continue;
840
+ const sourceHandle = fk.fromColumns.length === 1 ? getFkHandle(sourceNodeId, fk.fromColumns[0]) : "source-default";
841
+ if (drawnEdge.has(`${sourceNodeId}|${sourceHandle}|${targetNodeId}`)) continue;
842
+ drawnEdge.add(`${sourceNodeId}|${sourceHandle}|${targetNodeId}`);
843
+ const targetColumn = fk.toColumns.length === 1 ? nodeColumns.get(targetNodeId)?.find((c) => c.name === fk.toColumns[0]) : void 0;
844
+ edges.push({
845
+ id: `edge-fk-${sourceNodeId}-${fk.name}`,
846
+ source: sourceNodeId,
847
+ target: targetNodeId,
848
+ sourceHandle,
849
+ targetHandle: targetColumn ? `target-${targetColumn.name}` : getPkHandle(targetNodeId),
850
+ type: "relationEdge",
851
+ data: {
852
+ cardinality: "one",
853
+ direction: "owning",
854
+ relationName: fk.name,
855
+ hasJunction: false,
856
+ hasJoinPath: false,
857
+ label: getCardinalityLabel("one", "owning")
858
+ },
859
+ markerEnd: {
860
+ type: MarkerType.ArrowClosed,
861
+ width: 16,
862
+ height: 16
863
+ }
864
+ });
865
+ }
866
+ }
435
867
  return {
436
868
  nodes,
437
869
  edges
@@ -464,7 +896,6 @@ var placeGraph = (graph, positions) => {
464
896
  })
465
897
  };
466
898
  };
467
- var isJunctionNode = (node) => Boolean(node.data.isJunction);
468
899
  /**
469
900
  * The tables within `depth` relations of `focus`, and every relation between
470
901
  * them.
@@ -518,12 +949,19 @@ var EMPTY_GRAPH = {
518
949
  edges: []
519
950
  };
520
951
  var NO_POSITIONS = {};
521
- var useSchemaGraph = (descriptors, liveRls = null, focus = null, depth = 1) => {
952
+ var useSchemaGraph = (descriptors, liveRls = null, focus = null, depth = 1, options = {}) => {
522
953
  const [version, setVersion] = useState(0);
523
954
  const relayout = useCallback(() => setVersion((v) => v + 1), []);
524
- const graph = useMemo(() => descriptors && descriptors.length > 0 ? buildGraph(descriptors, liveRls) : EMPTY_GRAPH, [descriptors, liveRls]);
955
+ const { catalog, alwaysFocus = false } = options;
956
+ const graph = useMemo(() => descriptors && descriptors.length > 0 || catalog && catalog.length > 0 ? buildGraph(descriptors ?? [], liveRls, catalog) : EMPTY_GRAPH, [
957
+ descriptors,
958
+ liveRls,
959
+ catalog
960
+ ]);
525
961
  const tables = graph.nodes.filter((node) => !isJunctionNode(node)).length;
526
- const focused = tables > 300 ? (focus && graph.nodes.some((node) => node.id === focus) ? focus : mostConnectedTable(graph)) ?? null : null;
962
+ const large = tables > 300;
963
+ const focusIsTable = focus !== null && graph.nodes.some((node) => node.id === focus);
964
+ const focused = alwaysFocus ? focusIsTable ? focus : null : large ? (focusIsTable ? focus : mostConnectedTable(graph)) ?? null : null;
527
965
  const drawn = useMemo(() => focused ? neighbourhoodOf(graph, focused, depth) : graph, [
528
966
  graph,
529
967
  focused,
@@ -664,7 +1102,7 @@ function useLiveRlsTables() {
664
1102
  */
665
1103
  var TableNodeInner = ({ data, selected }) => {
666
1104
  const { t } = useTranslation();
667
- const { tableName, collectionName, columns, isJunction, rlsEnabled, historyEnabled, icon } = data;
1105
+ const { tableName, collectionName, columns, isJunction, rlsEnabled, historyEnabled, isUnmanaged, icon } = data;
668
1106
  const handles = useMemo(() => {
669
1107
  const result = [];
670
1108
  const cols = columns;
@@ -791,13 +1229,23 @@ var TableNodeInner = ({ data, selected }) => {
791
1229
  }),
792
1230
  /* @__PURE__ */ jsxs("div", {
793
1231
  className: "ml-auto flex items-center gap-1 shrink-0",
794
- children: [rlsEnabled && /* @__PURE__ */ jsx(Tooltip, {
795
- title: t("studio_rls_enabled"),
796
- children: /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-green-500" })
797
- }), historyEnabled && /* @__PURE__ */ jsx(Tooltip, {
798
- title: t("studio_schema_visualizer_history_enabled"),
799
- children: /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-blue-400" })
800
- })]
1232
+ children: [
1233
+ isUnmanaged && /* @__PURE__ */ jsx(Tooltip, {
1234
+ title: t("studio_tables_diagram_not_served_tooltip"),
1235
+ children: /* @__PURE__ */ jsx("div", {
1236
+ "aria-label": t("studio_tables_diagram_not_served"),
1237
+ className: "w-1.5 h-1.5 rounded-full bg-text-disabled dark:bg-text-disabled-dark"
1238
+ })
1239
+ }),
1240
+ rlsEnabled && /* @__PURE__ */ jsx(Tooltip, {
1241
+ title: t("studio_rls_enabled"),
1242
+ children: /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-green-500" })
1243
+ }),
1244
+ historyEnabled && /* @__PURE__ */ jsx(Tooltip, {
1245
+ title: t("studio_schema_visualizer_history_enabled"),
1246
+ children: /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-blue-400" })
1247
+ })
1248
+ ]
801
1249
  })
802
1250
  ]
803
1251
  }),
@@ -916,542 +1364,256 @@ var RelationEdgeInner = ({ id, sourceX, sourceY, targetX, targetY, sourcePositio
916
1364
  };
917
1365
  var RelationEdge = memo(RelationEdgeInner);
918
1366
  //#endregion
919
- //#region src/components/SchemaVisualizer/SchemaVisualizer.tsx
1367
+ //#region src/components/SchemaVisualizer/TablesDiagram.tsx
920
1368
  var nodeTypes = { tableNode: TableNode };
921
1369
  var edgeTypes = { relationEdge: RelationEdge };
922
- function SchemaVisualizerCanvas({ tables }) {
1370
+ function DiagramCanvas({ catalog, focusTable = null, alwaysFocus = false, highlightTable = null, onOpenTable, compact = false }) {
923
1371
  const { t } = useTranslation();
924
1372
  const reactFlowInstance = useReactFlow();
1373
+ const descriptors = useTableDescriptors();
925
1374
  const liveRls = useLiveRlsTables();
926
1375
  const isDark = useIsDarkMode();
927
- const [focus, setFocus] = useState(null);
928
1376
  const [depth, setDepth] = useState(1);
929
- const { nodes: layoutedNodes, edges: layoutedEdges, allNodes, relayout, tableCount, relationCount, layingOut, neighbourhood } = useSchemaGraph(tables, liveRls, focus, depth);
1377
+ const [largeFocus, setLargeFocus] = useState(null);
1378
+ const focus = focusTable ? `table-${focusTable}` : largeFocus;
1379
+ const { nodes: laidOutNodes, edges: laidOutEdges, relayout, layingOut, neighbourhood, allNodes } = useSchemaGraph(descriptors.tables, liveRls, focus, depth, {
1380
+ catalog,
1381
+ alwaysFocus
1382
+ });
930
1383
  const [nodes, setNodes] = useState([]);
931
1384
  const [edges, setEdges] = useState([]);
932
- const [selectedTable, setSelectedTable] = useState(null);
933
- const [searchQuery, setSearchQuery] = useState("");
934
1385
  useEffect(() => {
935
1386
  if (layingOut) return;
936
- setNodes(layoutedNodes);
937
- setEdges(layoutedEdges);
1387
+ setNodes(laidOutNodes);
1388
+ setEdges(laidOutEdges);
938
1389
  }, [
939
- layoutedNodes,
940
- layoutedEdges,
1390
+ laidOutNodes,
1391
+ laidOutEdges,
941
1392
  layingOut
942
1393
  ]);
943
- const onNodesChange = useCallback((changes) => setNodes((nds) => applyNodeChanges(changes, nds)), []);
944
- const onEdgesChange = useCallback((changes) => setEdges((eds) => applyEdgeChanges(changes, eds)), []);
1394
+ const selectedId = `table-${highlightTable ?? focusTable}`;
1395
+ useEffect(() => {
1396
+ setNodes((current) => current.map((node) => Boolean(node.selected) === (node.id === selectedId) ? node : {
1397
+ ...node,
1398
+ selected: node.id === selectedId
1399
+ }));
1400
+ }, [selectedId, laidOutNodes]);
1401
+ const onNodesChange = useCallback((changes) => setNodes((current) => applyNodeChanges(changes, current)), []);
1402
+ const onEdgesChange = useCallback((changes) => setEdges((current) => applyEdgeChanges(changes, current)), []);
945
1403
  /**
946
- * Fit the graph into view when it is first drawn, and again whenever a
947
- * different neighbourhood replaces it.
948
- *
949
- * `fitView` needs every node's real width and height, which React Flow
950
- * only knows once it has rendered and measured them; a fit made before
951
- * that leaves the ERD a scatter of specks in a corner. React Flow's own
952
- * `fitView` waits for the measurement, so it is asked for in the commit
953
- * that hands it the new nodes — after its store has them, which a
954
- * child's effect does before this one runs.
1404
+ * Fit the graph into view when it is first drawn, and whenever another
1405
+ * neighbourhood replaces it. React Flow's own `fitView` waits for the
1406
+ * nodes to be measured, so it is asked for in the commit that hands them over.
955
1407
  */
956
1408
  const fitPending = useRef(true);
957
1409
  useEffect(() => {
958
- if (!fitPending.current || nodes.length === 0) return;
1410
+ fitPending.current = true;
1411
+ }, [neighbourhood?.focus ?? null, depth]);
1412
+ const nodesInitialized = useNodesInitialized();
1413
+ useEffect(() => {
1414
+ if (!fitPending.current || nodes.length === 0 || !nodesInitialized) return;
959
1415
  fitPending.current = false;
960
1416
  reactFlowInstance.fitView({
961
1417
  padding: .15,
962
1418
  duration: 400
963
1419
  });
964
- }, [nodes, reactFlowInstance]);
965
- const handleFitView = useCallback(() => {
966
- reactFlowInstance.fitView({
967
- padding: .15,
968
- duration: 400
969
- });
970
- }, [reactFlowInstance]);
971
- const handleNodeClick = useCallback((_, node) => {
972
- setSelectedTable(node.id);
973
- }, []);
974
- const handlePaneClick = useCallback(() => {
975
- setSelectedTable(null);
976
- }, []);
977
- const handleTableSelect = useCallback((nodeId) => {
978
- setSelectedTable(nodeId);
979
- if (neighbourhood) {
980
- if (neighbourhood.focus !== nodeId) {
981
- fitPending.current = true;
982
- setFocus(nodeId);
983
- }
1420
+ }, [
1421
+ nodes,
1422
+ nodesInitialized,
1423
+ reactFlowInstance
1424
+ ]);
1425
+ useEffect(() => {
1426
+ if (!highlightTable) return;
1427
+ const nodeId = `table-${highlightTable}`;
1428
+ if (neighbourhood && !alwaysFocus && neighbourhood.focus !== nodeId) {
1429
+ setLargeFocus(nodeId);
984
1430
  return;
985
1431
  }
986
- const node = nodes.find((n) => n.id === nodeId);
1432
+ const node = nodes.find((candidate) => candidate.id === nodeId);
987
1433
  if (node) reactFlowInstance.setCenter(node.position.x + 140, node.position.y + 60, {
988
- zoom: 1.2,
1434
+ zoom: 1.1,
989
1435
  duration: 400
990
1436
  });
991
- }, [
992
- nodes,
993
- reactFlowInstance,
994
- neighbourhood
995
- ]);
996
- const handleDepthChange = useCallback((value) => {
997
- fitPending.current = true;
998
- setDepth(value === "2" ? 2 : 1);
999
- }, []);
1000
- const [sidebarSize, setSidebarSize] = useState(() => {
1001
- try {
1002
- const saved = localStorage.getItem("rebase_schema_viz_sidebar_size");
1003
- return saved !== null ? parseFloat(saved) : 20;
1004
- } catch {
1005
- return 20;
1006
- }
1007
- });
1008
- useEffect(() => {
1009
- try {
1010
- localStorage.setItem("rebase_schema_viz_sidebar_size", sidebarSize.toString());
1011
- } catch {}
1012
- }, [sidebarSize]);
1013
- const drawnTables = useMemo(() => tables.filter((table) => table.kind === "table"), [tables]);
1014
- const filteredTables = useMemo(() => {
1015
- if (!searchQuery.trim()) return drawnTables;
1016
- const q = searchQuery.toLowerCase();
1017
- return drawnTables.filter((table) => table.name.toLowerCase().includes(q) || table.table.toLowerCase().includes(q) || table.slug.toLowerCase().includes(q));
1018
- }, [drawnTables, searchQuery]);
1019
- const junctionNodes = useMemo(() => allNodes.filter((n) => n.data.isJunction), [allNodes]);
1020
- /**
1021
- * The RLS answer for one table, from the same place the graph used.
1022
- *
1023
- * The graph's nodes already carry it, so look it up there rather than
1024
- * re-deriving — that is what kept the sidebar dots, the node badges and the
1025
- * total from agreeing. Every node, not only the drawn ones: a large schema
1026
- * draws a neighbourhood, and the list shows every table.
1027
- */
1028
- const rlsByNodeId = useMemo(() => new Map(allNodes.map((n) => [n.id, Boolean(n.data.rlsEnabled)])), [allNodes]);
1029
- const rlsEnabledFor = useCallback((table) => rlsByNodeId.get(`table-${table.table}`) ?? false, [rlsByNodeId]);
1030
- const focusName = useMemo(() => {
1031
- const node = neighbourhood ? allNodes.find((n) => n.id === neighbourhood.focus) : void 0;
1032
- return node ? node.data.collectionName : "";
1033
- }, [allNodes, neighbourhood]);
1034
- const stats = useMemo(() => ({
1035
- tables: tableCount,
1036
- relations: relationCount,
1037
- junctions: junctionNodes.length,
1038
- withRls: allNodes.filter((n) => n.data?.rlsEnabled).length
1039
- }), [
1040
- tableCount,
1041
- relationCount,
1042
- junctionNodes.length,
1043
- allNodes
1044
- ]);
1045
- return /* @__PURE__ */ jsx(ResizablePanels, {
1046
- dividerAriaLabel: t("resize_sidebar"),
1047
- orientation: "horizontal",
1048
- panelSizePercent: sidebarSize,
1049
- onPanelSizeChange: setSidebarSize,
1050
- minPanelSizePx: 220,
1051
- firstPanel: /* @__PURE__ */ jsxs("div", {
1052
- className: cls("flex flex-col h-full w-full bg-surface-card border-r", defaultBorderMixin),
1053
- children: [
1054
- /* @__PURE__ */ jsxs("div", {
1055
- className: cls("flex items-center justify-between px-3 border-b bg-surface-sheet h-[42px] shrink-0", defaultBorderMixin),
1056
- children: [/* @__PURE__ */ jsx(Typography, {
1057
- variant: "caption",
1058
- className: "font-semibold uppercase tracking-wider text-text-disabled dark:text-text-disabled-dark",
1059
- children: "Tables"
1060
- }), /* @__PURE__ */ jsx(Typography, {
1061
- variant: "caption",
1062
- className: "text-xs text-text-disabled dark:text-text-disabled-dark font-mono",
1063
- children: stats.tables
1064
- })]
1065
- }),
1066
- /* @__PURE__ */ jsx("div", {
1067
- className: "px-2 py-1.5 border-b border-hairline",
1068
- children: /* @__PURE__ */ jsx(SearchBar, {
1069
- size: "smallest",
1070
- placeholder: "Filter tables…",
1071
- onTextSearch: (val) => setSearchQuery(val ?? ""),
1072
- innerClassName: "text-xs"
1437
+ }, [highlightTable]);
1438
+ const handleNodeClick = useCallback((_, node) => {
1439
+ onOpenTable?.(node.data.tableName);
1440
+ }, [onOpenTable]);
1441
+ const focusName = neighbourhood ? (allNodes.find((node) => node.id === neighbourhood.focus)?.data)?.tableName ?? "" : "";
1442
+ return /* @__PURE__ */ jsxs("div", {
1443
+ className: "relative h-full w-full",
1444
+ children: [
1445
+ /* @__PURE__ */ jsxs(ReactFlow, {
1446
+ nodes,
1447
+ edges,
1448
+ onNodesChange,
1449
+ onEdgesChange,
1450
+ onNodeClick: handleNodeClick,
1451
+ nodeTypes,
1452
+ edgeTypes,
1453
+ fitView: true,
1454
+ fitViewOptions: { padding: .15 },
1455
+ minZoom: .1,
1456
+ maxZoom: 2,
1457
+ proOptions: { hideAttribution: true },
1458
+ colorMode: isDark ? "dark" : "light",
1459
+ className: "bg-surface-well",
1460
+ children: [
1461
+ /* @__PURE__ */ jsx(Background, {
1462
+ variant: BackgroundVariant.Dots,
1463
+ gap: 20,
1464
+ size: 1,
1465
+ className: "!bg-surface-well",
1466
+ color: isDark ? "#272a2f" : "#d9d9dc"
1467
+ }),
1468
+ /* @__PURE__ */ jsx(Controls, {
1469
+ showInteractive: false,
1470
+ className: "!bg-surface-card !border !border-hairline !shadow-sm !rounded-lg [--xy-controls-button-background-color:var(--color-surface-card)] [--xy-controls-button-background-color-hover:var(--color-surface-card-hover)] [--xy-controls-button-color:var(--color-text-secondary)] dark:[--xy-controls-button-color:var(--color-text-secondary-dark)] [--xy-controls-button-color-hover:var(--color-text-primary)] dark:[--xy-controls-button-color-hover:var(--color-text-primary-dark)] [--xy-controls-button-border-color:var(--color-hairline)]"
1471
+ }),
1472
+ !compact && /* @__PURE__ */ jsx(MiniMap, {
1473
+ nodeStrokeColor: (node) => {
1474
+ const data = node.data;
1475
+ if (data.isJunction) return "#a78bfa";
1476
+ if (data.rlsEnabled) return "#22c55e";
1477
+ return "#6366f1";
1478
+ },
1479
+ nodeColor: (node) => node.data.isJunction ? isDark ? "#3b2f6b" : "#ede9fe" : isDark ? "#2b2d4a" : "#eef2ff",
1480
+ maskColor: isDark ? "rgba(0,0,0,0.35)" : "rgba(0,0,0,0.08)",
1481
+ className: "!bg-surface-card !border !border-hairline !shadow-sm !rounded-lg"
1073
1482
  })
1074
- }),
1075
- /* @__PURE__ */ jsxs("div", {
1076
- className: "flex-grow overflow-y-auto no-scrollbar p-1",
1077
- children: [/* @__PURE__ */ jsx("div", {
1078
- className: "space-y-0.5",
1079
- children: filteredTables.map((descriptor) => {
1080
- const table = descriptor.table;
1081
- const nodeId = `table-${table}`;
1082
- return /* @__PURE__ */ jsxs("div", {
1083
- onClick: () => handleTableSelect(nodeId),
1084
- className: cls("flex items-center p-1.5 cursor-pointer rounded-lg transition-colors group", selectedTable === nodeId ? "bg-surface-active text-text-primary dark:text-text-primary-dark font-medium" : "hover:bg-surface-hover text-text-secondary dark:text-text-secondary-dark"),
1085
- children: [
1086
- /* @__PURE__ */ jsx("div", {
1087
- className: "shrink-0 mr-1.5 text-text-disabled dark:text-text-disabled-dark",
1088
- children: /* @__PURE__ */ jsx(IconForView, {
1089
- collectionOrView: {
1090
- slug: descriptor.slug,
1091
- name: descriptor.name
1092
- },
1093
- size: "smallest"
1094
- })
1095
- }),
1096
- /* @__PURE__ */ jsxs("div", {
1097
- className: "flex flex-col min-w-0 flex-1",
1098
- children: [/* @__PURE__ */ jsx(Typography, {
1099
- variant: "caption",
1100
- className: "text-xs truncate font-medium",
1101
- children: descriptor.name
1102
- }), table !== descriptor.name && /* @__PURE__ */ jsx(Typography, {
1103
- variant: "caption",
1104
- className: "text-xs text-text-disabled dark:text-text-disabled-dark font-mono truncate",
1105
- children: table
1106
- })]
1107
- }),
1108
- /* @__PURE__ */ jsxs("div", {
1109
- className: "flex items-center gap-1 shrink-0 ml-1",
1110
- children: [rlsEnabledFor(descriptor) && /* @__PURE__ */ jsx(Tooltip, {
1111
- title: t("studio_rls_enabled"),
1112
- children: /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-green-500" })
1113
- }), descriptor.history && /* @__PURE__ */ jsx(Tooltip, {
1114
- title: t("studio_schema_visualizer_history_enabled"),
1115
- children: /* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-blue-400" })
1116
- })]
1117
- })
1118
- ]
1119
- }, nodeId);
1120
- })
1121
- }), junctionNodes.length > 0 && /* @__PURE__ */ jsxs("div", {
1122
- className: "mt-3",
1483
+ ]
1484
+ }),
1485
+ /* @__PURE__ */ jsxs("div", {
1486
+ className: "absolute top-3 left-3 right-3 flex items-start justify-between gap-2 pointer-events-none",
1487
+ children: [/* @__PURE__ */ jsx("div", {
1488
+ className: "pointer-events-auto",
1489
+ children: neighbourhood && /* @__PURE__ */ jsxs("div", {
1490
+ className: "flex flex-wrap items-center gap-2 px-3 py-1.5 bg-surface-card rounded-lg border border-hairline shadow-sm",
1123
1491
  children: [/* @__PURE__ */ jsx(Typography, {
1124
1492
  variant: "caption",
1125
- className: "px-1.5 text-[10px] uppercase tracking-wider text-text-disabled dark:text-text-disabled-dark font-medium",
1126
- children: "Junction Tables"
1127
- }), /* @__PURE__ */ jsx("div", {
1128
- className: "mt-1 space-y-0.5",
1129
- children: junctionNodes.map((node) => {
1130
- const d = node.data;
1131
- return /* @__PURE__ */ jsxs("div", {
1132
- onClick: () => handleTableSelect(node.id),
1133
- className: cls("flex items-center p-1.5 cursor-pointer rounded-lg transition-colors", selectedTable === node.id ? "bg-surface-active text-text-primary dark:text-text-primary-dark font-medium" : "hover:bg-surface-hover text-text-disabled dark:text-text-disabled-dark"),
1134
- children: [/* @__PURE__ */ jsx("svg", {
1135
- className: "w-3.5 h-3.5 mr-1.5 shrink-0",
1136
- fill: "none",
1137
- stroke: "currentColor",
1138
- viewBox: "0 0 24 24",
1139
- children: /* @__PURE__ */ jsx("path", {
1140
- strokeLinecap: "round",
1141
- strokeLinejoin: "round",
1142
- strokeWidth: 2,
1143
- d: "M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"
1144
- })
1145
- }), /* @__PURE__ */ jsx(Typography, {
1146
- variant: "caption",
1147
- className: "text-xs font-mono truncate",
1148
- children: d.tableName
1149
- })]
1150
- }, node.id);
1493
+ color: "secondary",
1494
+ children: alwaysFocus ? t("studio_tables_diagram_neighbourhood", {
1495
+ shown: neighbourhood.shown,
1496
+ total: neighbourhood.total,
1497
+ table: focusName
1498
+ }) : t("studio_schema_neighbourhood", {
1499
+ shown: neighbourhood.shown,
1500
+ total: neighbourhood.total,
1501
+ table: focusName
1151
1502
  })
1503
+ }), /* @__PURE__ */ jsx(ToggleButtonGroup, {
1504
+ "aria-label": t("studio_tables_diagram_depth"),
1505
+ value: String(neighbourhood.depth),
1506
+ onValueChange: (value) => setDepth(value === "2" ? 2 : 1),
1507
+ options: [{
1508
+ value: "1",
1509
+ label: t("studio_schema_neighbourhood_depth_1")
1510
+ }, {
1511
+ value: "2",
1512
+ label: t("studio_schema_neighbourhood_depth_2")
1513
+ }]
1152
1514
  })]
1153
- })]
1154
- }),
1155
- /* @__PURE__ */ jsxs("div", {
1156
- className: cls("px-3 py-2 border-t bg-surface-sheet space-y-1", defaultBorderMixin),
1157
- children: [
1158
- /* @__PURE__ */ jsxs("div", {
1159
- className: "flex items-center justify-between",
1160
- children: [/* @__PURE__ */ jsx(Typography, {
1161
- variant: "caption",
1162
- className: "text-xs text-text-disabled dark:text-text-disabled-dark",
1163
- children: "Tables"
1164
- }), /* @__PURE__ */ jsx(Typography, {
1165
- variant: "caption",
1166
- className: "text-xs font-mono font-medium",
1167
- children: stats.tables
1168
- })]
1169
- }),
1170
- /* @__PURE__ */ jsxs("div", {
1171
- className: "flex items-center justify-between",
1172
- children: [/* @__PURE__ */ jsx(Typography, {
1173
- variant: "caption",
1174
- className: "text-xs text-text-disabled dark:text-text-disabled-dark",
1175
- children: "Relations"
1176
- }), /* @__PURE__ */ jsx(Typography, {
1177
- variant: "caption",
1178
- className: "text-xs font-mono font-medium",
1179
- children: stats.relations
1180
- })]
1181
- }),
1182
- /* @__PURE__ */ jsxs("div", {
1183
- className: "flex items-center justify-between",
1184
- children: [/* @__PURE__ */ jsx(Typography, {
1185
- variant: "caption",
1186
- className: "text-xs text-text-disabled dark:text-text-disabled-dark",
1187
- children: "RLS protected"
1188
- }), /* @__PURE__ */ jsxs("div", {
1189
- className: "flex items-center gap-1",
1190
- children: [/* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), /* @__PURE__ */ jsx(Typography, {
1191
- variant: "caption",
1192
- className: "text-xs font-mono font-medium",
1193
- children: stats.withRls
1194
- })]
1195
- })]
1196
- })
1197
- ]
1198
- })
1199
- ]
1200
- }),
1201
- secondPanel: /* @__PURE__ */ jsxs("div", {
1202
- className: "flex-grow flex flex-col min-w-0 h-full w-full bg-surface-card",
1203
- children: [/* @__PURE__ */ jsxs("div", {
1204
- className: cls("flex items-center justify-between pr-2 border-b bg-surface-sheet h-[42px] shrink-0", defaultBorderMixin),
1205
- children: [/* @__PURE__ */ jsxs("div", {
1206
- className: "flex flex-col min-w-0 px-4",
1207
- children: [/* @__PURE__ */ jsx(Typography, {
1208
- variant: "subtitle2",
1209
- className: "font-medium text-text-primary dark:text-text-primary-dark",
1210
- children: t("studio_tool_schema_visualizer")
1211
- }), /* @__PURE__ */ jsx(Typography, {
1212
- variant: "caption",
1213
- className: "text-text-secondary dark:text-text-secondary-dark truncate",
1214
- children: t("studio_schema_visualizer_source")
1215
- })]
1515
+ })
1216
1516
  }), /* @__PURE__ */ jsxs("div", {
1217
- className: "flex shrink-0 items-center gap-1.5",
1517
+ className: "flex items-center gap-1 px-1 py-0.5 bg-surface-card rounded-lg border border-hairline shadow-sm pointer-events-auto",
1218
1518
  children: [/* @__PURE__ */ jsx(Tooltip, {
1219
1519
  title: t("studio_schema_visualizer_fit_view"),
1220
1520
  children: /* @__PURE__ */ jsx(IconButton, {
1221
1521
  "aria-label": t("studio_schema_visualizer_fit_view"),
1222
1522
  size: "small",
1223
- onClick: handleFitView,
1224
- children: /* @__PURE__ */ jsx("svg", {
1225
- className: "w-4 h-4",
1226
- fill: "none",
1227
- stroke: "currentColor",
1228
- viewBox: "0 0 24 24",
1229
- children: /* @__PURE__ */ jsx("path", {
1230
- strokeLinecap: "round",
1231
- strokeLinejoin: "round",
1232
- strokeWidth: 2,
1233
- d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"
1234
- })
1235
- })
1523
+ onClick: () => void reactFlowInstance.fitView({
1524
+ padding: .15,
1525
+ duration: 400
1526
+ }),
1527
+ children: /* @__PURE__ */ jsx(Maximize2Icon, { size: iconSize.smallest })
1236
1528
  })
1237
1529
  }), /* @__PURE__ */ jsx(Tooltip, {
1238
- title: "Re-layout",
1530
+ title: t("studio_tables_diagram_relayout"),
1239
1531
  children: /* @__PURE__ */ jsx(IconButton, {
1240
- "aria-label": "Re-layout",
1532
+ "aria-label": t("studio_tables_diagram_relayout"),
1241
1533
  size: "small",
1242
1534
  onClick: relayout,
1243
- children: /* @__PURE__ */ jsx("svg", {
1244
- className: "w-4 h-4",
1245
- fill: "none",
1246
- stroke: "currentColor",
1247
- viewBox: "0 0 24 24",
1248
- children: /* @__PURE__ */ jsx("path", {
1249
- strokeLinecap: "round",
1250
- strokeLinejoin: "round",
1251
- strokeWidth: 2,
1252
- d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"
1253
- })
1254
- })
1535
+ children: /* @__PURE__ */ jsx(RefreshCwIcon, { size: iconSize.smallest })
1255
1536
  })
1256
1537
  })]
1257
1538
  })]
1258
- }), /* @__PURE__ */ jsxs("div", {
1259
- className: "flex-grow relative",
1539
+ }),
1540
+ layingOut && /* @__PURE__ */ jsx("div", {
1541
+ role: "status",
1542
+ className: "absolute inset-0 flex items-center justify-center pointer-events-none",
1543
+ children: /* @__PURE__ */ jsxs("div", {
1544
+ className: "flex items-center gap-2 px-3 py-2 bg-surface-card rounded-lg border border-hairline shadow-sm",
1545
+ children: [/* @__PURE__ */ jsx(CircularProgress, { size: "smallest" }), /* @__PURE__ */ jsx(Typography, {
1546
+ variant: "caption",
1547
+ color: "secondary",
1548
+ children: t("studio_schema_laying_out")
1549
+ })]
1550
+ })
1551
+ }),
1552
+ !compact && /* @__PURE__ */ jsxs("div", {
1553
+ className: "absolute bottom-3 right-3 flex items-center gap-3 px-3 py-1.5 bg-surface-card rounded-lg border border-hairline shadow-sm",
1260
1554
  children: [
1261
- /* @__PURE__ */ jsxs(ReactFlow, {
1262
- nodes,
1263
- edges,
1264
- onNodesChange,
1265
- onEdgesChange,
1266
- onNodeClick: handleNodeClick,
1267
- onPaneClick: handlePaneClick,
1268
- nodeTypes,
1269
- edgeTypes,
1270
- fitView: true,
1271
- fitViewOptions: { padding: .15 },
1272
- minZoom: .1,
1273
- maxZoom: 2,
1274
- proOptions: { hideAttribution: true },
1275
- colorMode: isDark ? "dark" : "light",
1276
- className: "bg-surface-well",
1277
- children: [
1278
- /* @__PURE__ */ jsx(Background, {
1279
- variant: BackgroundVariant.Dots,
1280
- gap: 20,
1281
- size: 1,
1282
- className: "!bg-surface-well",
1283
- color: isDark ? "#272a2f" : "#d9d9dc"
1284
- }),
1285
- /* @__PURE__ */ jsx(Controls, {
1286
- showInteractive: false,
1287
- className: "!mb-16 !bg-surface-card !border !border-hairline !shadow-sm !rounded-lg [--xy-controls-button-background-color:var(--color-surface-card)] [--xy-controls-button-background-color-hover:var(--color-surface-card-hover)] [--xy-controls-button-color:var(--color-text-secondary)] dark:[--xy-controls-button-color:var(--color-text-secondary-dark)] [--xy-controls-button-color-hover:var(--color-text-primary)] dark:[--xy-controls-button-color-hover:var(--color-text-primary-dark)] [--xy-controls-button-border-color:var(--color-hairline)]"
1288
- }),
1289
- /* @__PURE__ */ jsx(MiniMap, {
1290
- nodeStrokeColor: (n) => {
1291
- const d = n.data;
1292
- if (d.isJunction) return "#a78bfa";
1293
- if (d.rlsEnabled) return "#22c55e";
1294
- return "#6366f1";
1295
- },
1296
- nodeColor: (n) => {
1297
- if (n.data.isJunction) return isDark ? "#3b2f6b" : "#ede9fe";
1298
- return isDark ? "#2b2d4a" : "#eef2ff";
1299
- },
1300
- maskColor: isDark ? "rgba(0,0,0,0.35)" : "rgba(0,0,0,0.08)",
1301
- className: "!bg-surface-card !border !border-hairline !shadow-sm !rounded-lg"
1302
- })
1303
- ]
1555
+ /* @__PURE__ */ jsxs("div", {
1556
+ className: "flex items-center gap-1.5",
1557
+ children: [/* @__PURE__ */ jsx("div", { className: "w-5 h-0.5 bg-indigo-500 rounded" }), /* @__PURE__ */ jsx(Typography, {
1558
+ variant: "caption",
1559
+ color: "secondary",
1560
+ children: t("studio_tables_diagram_legend_fk")
1561
+ })]
1304
1562
  }),
1305
- neighbourhood && /* @__PURE__ */ jsx("div", {
1306
- className: "absolute top-4 left-4 right-4 flex justify-start pointer-events-none",
1307
- children: /* @__PURE__ */ jsxs("div", {
1308
- className: "flex flex-wrap items-center gap-2 max-w-full px-3 py-2 bg-surface-card/90 backdrop-blur-sm rounded-lg border border-hairline shadow-sm pointer-events-auto",
1309
- children: [/* @__PURE__ */ jsx(Typography, {
1310
- variant: "caption",
1311
- className: "text-text-secondary dark:text-text-secondary-dark",
1312
- children: t("studio_schema_neighbourhood", {
1313
- shown: neighbourhood.shown,
1314
- total: neighbourhood.total,
1315
- table: focusName
1316
- })
1317
- }), /* @__PURE__ */ jsx(ToggleButtonGroup, {
1318
- value: String(neighbourhood.depth),
1319
- onValueChange: handleDepthChange,
1320
- options: [{
1321
- value: "1",
1322
- label: t("studio_schema_neighbourhood_depth_1")
1323
- }, {
1324
- value: "2",
1325
- label: t("studio_schema_neighbourhood_depth_2")
1326
- }]
1327
- })]
1328
- })
1563
+ /* @__PURE__ */ jsxs("div", {
1564
+ className: "flex items-center gap-1.5",
1565
+ children: [/* @__PURE__ */ jsx("div", { className: "w-5 h-0.5 bg-violet-500 rounded" }), /* @__PURE__ */ jsx(Typography, {
1566
+ variant: "caption",
1567
+ color: "secondary",
1568
+ children: t("studio_tables_diagram_legend_mn")
1569
+ })]
1329
1570
  }),
1330
- layingOut && /* @__PURE__ */ jsx("div", {
1331
- role: "status",
1332
- className: "absolute inset-0 flex items-center justify-center pointer-events-none",
1333
- children: /* @__PURE__ */ jsxs("div", {
1334
- className: "flex items-center gap-2 px-3 py-2 bg-surface-card/90 backdrop-blur-sm rounded-lg border border-hairline shadow-sm",
1335
- children: [/* @__PURE__ */ jsx(CircularProgress, { size: "smallest" }), /* @__PURE__ */ jsx(Typography, {
1336
- variant: "caption",
1337
- className: "text-text-secondary dark:text-text-secondary-dark",
1338
- children: t("studio_schema_laying_out")
1339
- })]
1340
- })
1571
+ /* @__PURE__ */ jsxs("div", {
1572
+ className: "flex items-center gap-1.5",
1573
+ children: [/* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), /* @__PURE__ */ jsx(Typography, {
1574
+ variant: "caption",
1575
+ color: "secondary",
1576
+ children: t("studio_rls_enabled")
1577
+ })]
1341
1578
  }),
1342
1579
  /* @__PURE__ */ jsxs("div", {
1343
- className: "absolute bottom-4 left-4 flex items-center gap-3 px-3 py-2 bg-surface-card/90 backdrop-blur-sm rounded-lg border border-hairline shadow-sm",
1344
- children: [
1345
- /* @__PURE__ */ jsxs("div", {
1346
- className: "flex items-center gap-1.5",
1347
- children: [/* @__PURE__ */ jsx("div", { className: "w-6 h-0.5 bg-indigo-500 rounded" }), /* @__PURE__ */ jsx(Typography, {
1348
- variant: "caption",
1349
- className: "text-xs text-text-disabled dark:text-text-disabled-dark",
1350
- children: "Owning"
1351
- })]
1352
- }),
1353
- /* @__PURE__ */ jsxs("div", {
1354
- className: "flex items-center gap-1.5",
1355
- children: [/* @__PURE__ */ jsx("div", { className: "w-6 h-0.5 bg-violet-500 rounded" }), /* @__PURE__ */ jsx(Typography, {
1356
- variant: "caption",
1357
- className: "text-xs text-text-disabled dark:text-text-disabled-dark",
1358
- children: "M:N"
1359
- })]
1360
- }),
1361
- /* @__PURE__ */ jsxs("div", {
1362
- className: "flex items-center gap-1.5",
1363
- children: [/* @__PURE__ */ jsx("div", {
1364
- className: "w-6 h-0.5 rounded",
1365
- style: { backgroundImage: "repeating-linear-gradient(90deg, #9da2aa, #9da2aa 4px, transparent 4px, transparent 7px)" }
1366
- }), /* @__PURE__ */ jsx(Typography, {
1367
- variant: "caption",
1368
- className: "text-xs text-text-disabled dark:text-text-disabled-dark",
1369
- children: "Inverse"
1370
- })]
1371
- }),
1372
- /* @__PURE__ */ jsx("div", { className: "h-3 w-px bg-surface-raised" }),
1373
- /* @__PURE__ */ jsxs("div", {
1374
- className: "flex items-center gap-1",
1375
- children: [/* @__PURE__ */ jsx("span", {
1376
- className: "text-[9px]",
1377
- children: "🔑"
1378
- }), /* @__PURE__ */ jsx(Typography, {
1379
- variant: "caption",
1380
- className: "text-xs text-text-disabled dark:text-text-disabled-dark",
1381
- children: "PK"
1382
- })]
1383
- }),
1384
- /* @__PURE__ */ jsxs("div", {
1385
- className: "flex items-center gap-1",
1386
- children: [/* @__PURE__ */ jsx("span", {
1387
- className: "text-[9px]",
1388
- children: "🔗"
1389
- }), /* @__PURE__ */ jsx(Typography, {
1390
- variant: "caption",
1391
- className: "text-xs text-text-disabled dark:text-text-disabled-dark",
1392
- children: "FK"
1393
- })]
1394
- })
1395
- ]
1580
+ className: "flex items-center gap-1.5",
1581
+ children: [/* @__PURE__ */ jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-text-disabled dark:bg-text-disabled-dark" }), /* @__PURE__ */ jsx(Typography, {
1582
+ variant: "caption",
1583
+ color: "secondary",
1584
+ children: t("studio_tables_diagram_not_served")
1585
+ })]
1396
1586
  })
1397
1587
  ]
1398
- })]
1399
- })
1588
+ })
1589
+ ]
1400
1590
  });
1401
1591
  }
1402
- var SchemaVisualizer = () => {
1592
+ /**
1593
+ * The schema as a diagram: the tables the server declares — with their
1594
+ * many-to-many relations drawn through junctions — and every other table and
1595
+ * foreign key the database's catalog holds.
1596
+ */
1597
+ function TablesDiagram(props) {
1403
1598
  const { t } = useTranslation();
1404
1599
  const descriptors = useTableDescriptors();
1405
- const problem = schemaSourceProblem(descriptors);
1406
- if (problem && descriptors.tables.length === 0) return /* @__PURE__ */ jsx(SchemaSourceProblemView, { problem });
1407
- /**
1408
- * Still loading and nothing to draw are different answers, and this view
1409
- * once rendered the same spinner for both. A project that declares no
1410
- * tables — a fresh scaffold, a backend someone opened the console against
1411
- * — sat on "Loading schema…" forever, because there was nothing coming.
1412
- */
1413
- if (descriptors.status === "loading") return /* @__PURE__ */ jsx("div", {
1414
- className: "flex items-center justify-center h-full w-full",
1600
+ if (!props.catalog.some((table) => table.kind === "table") && !descriptors.tables.some((table) => table.kind === "table")) return /* @__PURE__ */ jsx("div", {
1601
+ className: "flex items-center justify-center h-full w-full p-6",
1415
1602
  children: /* @__PURE__ */ jsxs("div", {
1416
- className: "text-center space-y-3",
1417
- children: [/* @__PURE__ */ jsx(CircularProgress, { size: "small" }), /* @__PURE__ */ jsx(Typography, {
1603
+ className: "max-w-md text-center flex flex-col gap-2",
1604
+ children: [/* @__PURE__ */ jsx(Typography, {
1605
+ variant: "subtitle2",
1606
+ children: t("studio_tables_diagram_empty")
1607
+ }), /* @__PURE__ */ jsx(Typography, {
1418
1608
  variant: "body2",
1419
1609
  color: "secondary",
1420
- children: t("studio_schema_loading")
1610
+ children: t("studio_tables_diagram_empty_body")
1421
1611
  })]
1422
1612
  })
1423
1613
  });
1424
- if (!descriptors.tables.some((table) => table.kind === "table")) return /* @__PURE__ */ jsx("div", {
1425
- className: "flex items-center justify-center h-full w-full p-6",
1426
- children: /* @__PURE__ */ jsxs("div", {
1427
- className: "max-w-md text-center space-y-2",
1428
- children: [
1429
- /* @__PURE__ */ jsx(Typography, {
1430
- variant: "subtitle2",
1431
- className: "block",
1432
- children: t("studio_schema_no_tables_declared")
1433
- }),
1434
- /* @__PURE__ */ jsx(Typography, {
1435
- variant: "body2",
1436
- color: "secondary",
1437
- className: "block",
1438
- children: t("studio_schema_no_tables_declared_body")
1439
- }),
1440
- /* @__PURE__ */ jsx(Typography, {
1441
- variant: "body2",
1442
- color: "secondary",
1443
- className: "block",
1444
- children: t("studio_schema_introspect_hint")
1445
- })
1446
- ]
1447
- })
1448
- });
1449
- return /* @__PURE__ */ jsx("div", {
1450
- className: "flex h-full w-full bg-surface-card overflow-hidden text-text-primary dark:text-text-primary-dark",
1451
- children: /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(SchemaVisualizerCanvas, { tables: descriptors.tables }) })
1452
- });
1453
- };
1614
+ return /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(DiagramCanvas, { ...props }) });
1615
+ }
1454
1616
  //#endregion
1455
- export { SchemaVisualizer };
1617
+ export { tablesLink as _, TABLE_PARAM as a, formatBytes as c, notServedReasonKey as d, parseFilterParam as f, sqlDraftLink as g, parseTablesResponse as h, TABLE_FILTER_PARAM as i, formatCount as l, parseTableDetails as m, ROW_FILTER_OPERATORS as n, TABLE_TAB_PARAM as o, parseRowsPage as p, TABLES_VIEW_PARAM as r, asPostgresPolicies as s, TablesDiagram as t, isInspectorTab as u };
1456
1618
 
1457
- //# sourceMappingURL=SchemaVisualizer-Dy4kWKT5.js.map
1619
+ //# sourceMappingURL=TablesDiagram-RTJfwVEN.js.map