@finos/legend-application-studio 28.15.8 → 28.15.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"SQLPlaygroundPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/panel-group/SQLPlaygroundPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAqaH,eAAO,MAAM,kBAAkB;;CAoM7B,CAAC"}
1
+ {"version":3,"file":"SQLPlaygroundPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/panel-group/SQLPlaygroundPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4gBH,eAAO,MAAM,kBAAkB;;CAqR7B,CAAC"}
@@ -15,7 +15,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
15
15
  * limitations under the License.
16
16
  */
17
17
  import { observer } from 'mobx-react-lite';
18
- import { ResizablePanelGroup, ResizablePanel, ResizablePanelSplitter, CustomSelectorInput, createFilter, PURE_ConnectionIcon, BlankPanelPlaceholder, PanelDropZone, ResizablePanelSplitterLine, PlayIcon, PanelLoadingIndicator, BlankPanelContent, TrashIcon, PURE_DatabaseIcon, SyncIcon, } from '@finos/legend-art';
18
+ import { ResizablePanelGroup, ResizablePanel, ResizablePanelSplitter, CustomSelectorInput, createFilter, PURE_ConnectionIcon, BlankPanelPlaceholder, PanelDropZone, ResizablePanelSplitterLine, PlayIcon, PanelLoadingIndicator, BlankPanelContent, PURE_DatabaseIcon, SyncIcon, clsx, CheckSquareIcon, SquareIcon, } from '@finos/legend-art';
19
19
  import React, { useCallback, useEffect, useRef, useState } from 'react';
20
20
  import { useApplicationStore, useCommands, useConditionedApplicationNavigationContext, } from '@finos/legend-application';
21
21
  import { flowResult } from 'mobx';
@@ -28,8 +28,8 @@ import { useEditorStore } from '../EditorStoreProvider.js';
28
28
  import { PANEL_MODE } from '../../../stores/editor/EditorConfig.js';
29
29
  import { useDrag, useDrop } from 'react-dnd';
30
30
  import { CORE_DND_TYPE, } from '../../../stores/editor/utils/DnDUtils.js';
31
- import { DataGrid } from '@finos/legend-lego/data-grid';
32
- import { getNonNullableEntry, getNullableEntry, getNullableLastEntry, isNonNullable, isString, parseCSVString, uniqBy, } from '@finos/legend-shared';
31
+ import { DataGrid, } from '@finos/legend-lego/data-grid';
32
+ import { getNonNullableEntry, getNullableEntry, getNullableLastEntry, isNonNullable, isNumber, isString, isValidURL, parseCSVString, prettyDuration, uniqBy, } from '@finos/legend-shared';
33
33
  import { DatabaseSchemaExplorer, DatabaseSchemaExplorerTreeNodeContainer, } from '../editor-group/connection-editor/DatabaseSchemaExplorer.js';
34
34
  import { DatabaseSchemaExplorerTreeTableNodeData } from '../../../stores/editor/editor-state/element-editor-state/connection/DatabaseBuilderState.js';
35
35
  import { buildRelationalDatabaseConnectionOption, } from '../editor-group/connection-editor/RelationalDatabaseConnectionEditor.js';
@@ -109,12 +109,6 @@ const PlaygroundSQLCodeEditor = observer(() => {
109
109
  const codeEditorRef = useRef(null);
110
110
  const [editor, setEditor] = useState();
111
111
  const sqlIdentifierSuggestionProviderDisposer = useRef(undefined);
112
- const executeRawSQL = () => {
113
- flowResult(playgroundState.executeRawSQL()).catch(applicationStore.alertUnhandledError);
114
- };
115
- const reset = () => {
116
- playgroundState.resetSQL();
117
- };
118
112
  useEffect(() => {
119
113
  if (!editor && codeEditorRef.current) {
120
114
  const element = codeEditorRef.current;
@@ -201,7 +195,7 @@ const PlaygroundSQLCodeEditor = observer(() => {
201
195
  isDatabaseNodeDragOver: monitor.isOver({ shallow: true }),
202
196
  }),
203
197
  }), [handleDatabaseNodeDrop]);
204
- return (_jsxs("div", { className: "sql-playground__code-editor", children: [_jsx(PanelLoadingIndicator, { isLoading: playgroundState.isExecutingRawSQL }), _jsx("div", { className: "sql-playground__code-editor__header", children: _jsxs("div", { className: "sql-playground__code-editor__header__actions", children: [_jsx("button", { className: "sql-playground__code-editor__header__action", tabIndex: -1, onClick: executeRawSQL, disabled: playgroundState.isExecutingRawSQL, title: "Execute (Ctrl + Enter)", children: _jsx(PlayIcon, {}) }), _jsx("button", { className: "sql-playground__code-editor__header__action", tabIndex: -1, onClick: reset, title: "Reset", children: _jsx(TrashIcon, {}) })] }) }), _jsx(PanelDropZone, { className: "sql-playground__code-editor__content", isDragOver: isDatabaseNodeDragOver, dropTargetConnector: dropConnector, children: _jsx("div", { className: "code-editor__container", children: _jsx("div", { className: "code-editor__body", ref: codeEditorRef }) }) })] }));
198
+ return (_jsx("div", { className: "sql-playground__code-editor", children: _jsx(PanelDropZone, { className: "sql-playground__code-editor__content", isDragOver: isDatabaseNodeDragOver, dropTargetConnector: dropConnector, children: _jsx("div", { className: "code-editor__container", children: _jsx("div", { className: "code-editor__body", ref: codeEditorRef }) }) }) }));
205
199
  });
206
200
  const parseExecutionResultData = (data) => {
207
201
  const lines = data.split('\n').filter((line) => line.trim().length);
@@ -225,12 +219,78 @@ const parseExecutionResultData = (data) => {
225
219
  }
226
220
  return undefined;
227
221
  };
222
+ const TDSResultCellRenderer = observer((params) => {
223
+ const cellValue = params.value;
224
+ const formattedCellValue = () => {
225
+ if (isNumber(cellValue)) {
226
+ return Intl.NumberFormat('en-US', {
227
+ maximumFractionDigits: 4,
228
+ }).format(Number(cellValue));
229
+ }
230
+ return cellValue;
231
+ };
232
+ const cellValueUrlLink = isString(cellValue) && isValidURL(cellValue) ? cellValue : undefined;
233
+ return (_jsx("div", { className: clsx('query-builder__result__values__table__cell'), children: cellValueUrlLink ? (_jsx("a", { href: cellValueUrlLink, target: "_blank", rel: "noreferrer", children: cellValueUrlLink })) : (_jsx("span", { children: formattedCellValue() })) }));
234
+ });
228
235
  const PlayGroundSQLExecutionResultGrid = observer((props) => {
229
- const { result } = props;
236
+ const { result, useAdvancedGrid, useLocalMode } = props;
230
237
  const data = parseExecutionResultData(result);
231
238
  if (!data) {
232
239
  return (_jsx(BlankPanelContent, { children: `Can't parse result, displaying raw form:\n${result}` }));
233
240
  }
241
+ if (useAdvancedGrid) {
242
+ if (useLocalMode) {
243
+ const localcolDefs = data.columns.map((colName) => ({
244
+ minWidth: 50,
245
+ sortable: true,
246
+ resizable: true,
247
+ field: colName,
248
+ flex: 1,
249
+ enablePivot: true,
250
+ enableRowGroup: true,
251
+ enableValue: true,
252
+ allowedAggFuncs: ['count'],
253
+ }));
254
+ return (_jsx(DataGrid, { rowData: data.rowData, gridOptions: {
255
+ suppressScrollOnNewData: true,
256
+ rowSelection: 'multiple',
257
+ pivotPanelShow: 'always',
258
+ rowGroupPanelShow: 'always',
259
+ enableRangeSelection: true,
260
+ },
261
+ // NOTE: when column definition changed, we need to force refresh the cell to make sure the cell renderer is updated
262
+ // See https://stackoverflow.com/questions/56341073/how-to-refresh-an-ag-grid-when-a-change-occurs-inside-a-custom-cell-renderer-com
263
+ onRowDataUpdated: (params) => {
264
+ params.api.refreshCells({ force: true });
265
+ }, suppressFieldDotNotation: true, suppressContextMenu: false, columnDefs: localcolDefs, sideBar: ['columns', 'filters'] }));
266
+ }
267
+ const colDefs = data.columns.map((colName) => ({
268
+ minWidth: 50,
269
+ sortable: true,
270
+ resizable: true,
271
+ field: colName,
272
+ flex: 1,
273
+ cellRenderer: TDSResultCellRenderer,
274
+ filter: true,
275
+ }));
276
+ const getContextMenuItems = useCallback((params) => [
277
+ 'copy',
278
+ 'copyWithHeaders',
279
+ {
280
+ name: 'Copy Row Value',
281
+ action: () => {
282
+ params.api.copySelectedRowsToClipboard();
283
+ },
284
+ },
285
+ ], []);
286
+ return (_jsx("div", { className: "sql-playground__result__grid ag-theme-balham-dark", children: _jsx(DataGrid, { rowData: data.rowData, overlayNoRowsTemplate: `<div class="sql-playground__result__grid--empty">No results</div>`, gridOptions: {
287
+ suppressScrollOnNewData: true,
288
+ rowSelection: 'multiple',
289
+ enableRangeSelection: true,
290
+ }, onRowDataUpdated: (params) => {
291
+ params.api.refreshCells({ force: true });
292
+ }, suppressFieldDotNotation: true, suppressClipboardPaste: false, suppressContextMenu: false, columnDefs: colDefs, getContextMenuItems: (params) => getContextMenuItems(params) }) }));
293
+ }
234
294
  return (_jsx("div", { className: "sql-playground__result__grid ag-theme-balham-dark", children: _jsx(DataGrid, { rowData: data.rowData, overlayNoRowsTemplate: `<div class="sql-playground__result__grid--empty">No results</div>`, alwaysShowVerticalScroll: true, suppressFieldDotNotation: true, columnDefs: data.columns.map((column) => ({
235
295
  minWidth: 50,
236
296
  sortable: true,
@@ -295,14 +355,27 @@ export const SQLPlaygroundPanel = observer(() => {
295
355
  flowResult(playgroundState.schemaExplorerState.updateDatabase()).catch(applicationStore.alertUnhandledError);
296
356
  }
297
357
  };
358
+ const executeRawSQL = () => {
359
+ flowResult(playgroundState.executeRawSQL()).catch(applicationStore.alertUnhandledError);
360
+ };
361
+ const advancedMode = Boolean(editorStore.applicationStore.config.options.queryBuilderConfig
362
+ ?.TEMPORARY__enableGridEnterpriseMode);
363
+ const resultDescription = playgroundState.sqlExecutionResult
364
+ ? `query ran in ${prettyDuration(playgroundState.sqlExecutionResult.sqlDuration, {
365
+ ms: true,
366
+ })}`
367
+ : undefined;
368
+ const toggleocalMode = () => {
369
+ playgroundState.toggleIsLocalModeEnabled();
370
+ };
298
371
  useEffect(() => {
299
372
  if (playgroundState.schemaExplorerState) {
300
373
  flowResult(playgroundState.schemaExplorerState.fetchDatabaseMetadata()).catch(applicationStore.alertUnhandledError);
301
374
  }
302
375
  }, [playgroundState, applicationStore, playgroundState.schemaExplorerState]);
303
376
  useConditionedApplicationNavigationContext(LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.SQL_PLAYGROUND, editorStore.activePanelMode === PANEL_MODE.SQL_PLAYGROUND);
304
- return (_jsx(PanelDropZone, { isDragOver: isConnectionDragOver, dropTargetConnector: dropConnector, children: _jsxs("div", { className: "sql-playground", children: [playgroundState.connection && (_jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsx(ResizablePanel, { size: 300, children: _jsxs("div", { className: "sql-playground__config", children: [_jsxs("div", { className: "sql-playground__config__setup", children: [_jsxs("div", { className: "sql-playground__config__connection-selector", children: [_jsx("div", { className: "sql-playground__config__connection-selector__icon", children: _jsx(PURE_ConnectionIcon, {}) }), _jsx(CustomSelectorInput, { ref: connectionSelectorRef, className: "sql-playground__config__connection-selector__input", options: connectionOptions, onChange: changeConnection, value: selectedConnectionOption, darkMode: true, placeholder: "Choose a connection...", filterOption: connectionFilterOption })] }), _jsxs("div", { className: "sql-playground__config__database-selector", children: [_jsx("div", { className: "sql-playground__config__database-selector__icon", children: _jsx(PURE_DatabaseIcon, {}) }), _jsx(CustomSelectorInput, { ref: connectionSelectorRef, className: "sql-playground__config__database-selector__input", options: connectionOptions, onChange: changeConnection, value: selectedConnectionOption, darkMode: true, placeholder: "Choose a connection...", filterOption: connectionFilterOption }), _jsx("button", { className: "sql-playground__config__database-selector__update-btn btn--sm btn--dark", disabled: !playgroundState.database ||
305
- playgroundState.isBuildingDatabase ||
306
- playgroundState.isUpdatingDatabase, onClick: updateDatabase, title: "Update database", children: _jsx(SyncIcon, {}) })] })] }), _jsx("div", { className: "sql-playground__config__schema-explorer", children: playgroundState.schemaExplorerState?.treeData && (_jsx(DatabaseSchemaExplorer, { treeData: playgroundState.schemaExplorerState.treeData, schemaExplorerState: playgroundState.schemaExplorerState, treeNodeContainerComponent: SQLPlaygroundDatabaseSchemaExplorerTreeNodeContainer })) })] }) }), _jsx(ResizablePanelSplitter, {}), _jsx(ResizablePanel, { children: _jsx("div", { className: "panel sql-playground__sql-editor", children: _jsxs(ResizablePanelGroup, { orientation: "horizontal", children: [_jsx(ResizablePanel, { children: _jsx(PlaygroundSQLCodeEditor, {}) }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-250)" }) }), _jsxs(ResizablePanel, { size: 300, children: [playgroundState.sqlExecutionResult !== undefined && (_jsx(PlayGroundSQLExecutionResultGrid, { result: playgroundState.sqlExecutionResult })), playgroundState.sqlExecutionResult === undefined && (_jsx("div", {}))] })] }) }) })] })), !playgroundState.connection && (_jsx(BlankPanelPlaceholder, { onClick: onPickConnection, clickActionType: "add", text: "Pick a connection to start", tooltipText: "Drop a connection to start...", isDropZoneActive: isConnectionDragOver }))] }) }));
377
+ return (_jsx(PanelDropZone, { isDragOver: isConnectionDragOver, dropTargetConnector: dropConnector, children: _jsxs("div", { className: "sql-playground", children: [playgroundState.connection && (_jsxs(ResizablePanelGroup, { orientation: "vertical", children: [_jsx(ResizablePanel, { size: 300, children: _jsxs("div", { className: "sql-playground__config", children: [_jsxs("div", { className: "sql-playground__config__setup", children: [_jsxs("div", { className: "sql-playground__config__connection-selector", children: [_jsx("div", { className: "sql-playground__config__connection-selector__icon", children: _jsx(PURE_ConnectionIcon, {}) }), _jsx(CustomSelectorInput, { ref: connectionSelectorRef, className: "sql-playground__config__connection-selector__input", options: connectionOptions, onChange: changeConnection, value: selectedConnectionOption, darkMode: true, placeholder: "Choose a connection...", filterOption: connectionFilterOption })] }), _jsxs("div", { className: "sql-playground__config__database-selector", children: [_jsx("div", { className: "sql-playground__config__database-selector__icon", children: _jsx(PURE_DatabaseIcon, {}) }), _jsx(CustomSelectorInput, { ref: connectionSelectorRef, className: "sql-playground__config__database-selector__input", options: connectionOptions, onChange: changeConnection, value: selectedConnectionOption, darkMode: true, placeholder: "Choose a connection...", filterOption: connectionFilterOption }), _jsx("button", { className: "sql-playground__config__database-selector__update-btn btn--sm btn--dark", disabled: !playgroundState.database, onClick: updateDatabase, title: "Update database", children: _jsx(SyncIcon, {}) })] })] }), _jsxs("div", { className: "sql-playground__config__schema-explorer", children: [_jsx(PanelLoadingIndicator, { isLoading: Boolean(playgroundState.schemaExplorerState?.isGeneratingDatabase) }), playgroundState.schemaExplorerState?.treeData && (_jsx(DatabaseSchemaExplorer, { treeData: playgroundState.schemaExplorerState.treeData, schemaExplorerState: playgroundState.schemaExplorerState, treeNodeContainerComponent: SQLPlaygroundDatabaseSchemaExplorerTreeNodeContainer }))] })] }) }), _jsx(ResizablePanelSplitter, {}), _jsx(ResizablePanel, { children: _jsx("div", { className: "panel sql-playground__sql-editor", children: _jsxs(ResizablePanelGroup, { orientation: "horizontal", children: [_jsx(ResizablePanel, { children: _jsx(PlaygroundSQLCodeEditor, {}) }), _jsx(ResizablePanelSplitter, { children: _jsx(ResizablePanelSplitterLine, { color: "var(--color-dark-grey-250)" }) }), _jsxs(ResizablePanel, { size: 300, children: [_jsxs("div", { className: "panel__header", children: [_jsxs("div", { className: "panel__header__title", children: [_jsx("div", { className: "panel__header__title__label", children: "result" }), playgroundState.executeRawSQLState.isInProgress && (_jsx("div", { className: "panel__header__title__label__status", children: "Running SQL..." })), _jsx("div", { className: "query-builder__result__analytics", children: resultDescription ?? '' })] }), _jsxs("div", { className: "panel__header__actions query-builder__result__header__actions", children: [advancedMode && (_jsxs("div", { className: "query-builder__result__advanced__mode", children: [_jsx("div", { className: "query-builder__result__advanced__mode__label", children: "Local Mode" }), _jsx("button", { className: clsx('query-builder__result__advanced__mode__toggler__btn', {
378
+ 'query-builder__result__advanced__mode__toggler__btn--toggled': playgroundState.isLocalModeEnabled,
379
+ }), onClick: toggleocalMode, tabIndex: -1, children: playgroundState.isLocalModeEnabled ? (_jsx(CheckSquareIcon, {})) : (_jsx(SquareIcon, {})) })] })), _jsx("div", { className: "query-builder__result__execute-btn btn__dropdown-combo btn__dropdown-combo--primary", children: _jsxs("button", { className: "btn__dropdown-combo__label", onClick: executeRawSQL, disabled: playgroundState.executeRawSQLState.isInProgress, tabIndex: -1, children: [_jsx(PlayIcon, { className: "btn__dropdown-combo__label__icon" }), _jsx("div", { className: "btn__dropdown-combo__label__title", children: "Run Query" })] }) })] })] }), playgroundState.sqlExecutionResult !== undefined && (_jsx(PlayGroundSQLExecutionResultGrid, { result: playgroundState.sqlExecutionResult.value, useAdvancedGrid: advancedMode, useLocalMode: playgroundState.isLocalModeEnabled })), playgroundState.sqlExecutionResult === undefined && (_jsx("div", {}))] })] }) }) })] })), !playgroundState.connection && (_jsx(BlankPanelPlaceholder, { onClick: onPickConnection, clickActionType: "add", text: "Pick a connection to start", tooltipText: "Drop a connection to start...", isDropZoneActive: isConnectionDragOver }))] }) }));
307
380
  });
308
381
  //# sourceMappingURL=SQLPlaygroundPanel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SQLPlaygroundPanel.js","sourceRoot":"","sources":["../../../../src/components/editor/panel-group/SQLPlaygroundPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EAEnB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,0BAA0B,EAC1B,QAAQ,EACR,qBAAqB,EACrB,iBAAiB,EACjB,SAAS,EACT,iBAAiB,EACjB,QAAQ,GACT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,0CAA0C,GAC3C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,SAAS,IAAI,kBAAkB,GAGhC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gDAAgD,EAAE,MAAM,8DAA8D,CAAC;AAChI,OAAO,EAAgC,MAAM,+DAA+D,CAAC;AAC7G,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAA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,CAAC,kBAAkB,KAAK,SAAS,IAAI,CACnD,eAAO,CACR,IACc,IACG,GAClB,GACS,IACG,CACvB,EACA,CAAC,eAAe,CAAC,UAAU,IAAI,CAC9B,KAAC,qBAAqB,IACpB,OAAO,EAAE,gBAAgB,EACzB,eAAe,EAAC,KAAK,EACrB,IAAI,EAAC,4BAA4B,EACjC,WAAW,EAAC,+BAA+B,EAC3C,gBAAgB,EAAE,oBAAoB,GACtC,CACH,IACG,GACQ,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"SQLPlaygroundPanel.js","sourceRoot":"","sources":["../../../../src/components/editor/panel-group/SQLPlaygroundPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EAEnB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,0BAA0B,EAC1B,QAAQ,EACR,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EACL,mBAAmB,EACnB,WAAW,EACX,0CAA0C,GAC3C,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,wBAAwB,GACzB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,MAAM,IAAI,eAAe,EACzB,SAAS,IAAI,kBAAkB,GAGhC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,qBAAqB,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a,EACtB,QAAQ,EACN,eAAe,CAAC,kBAAkB,CAAC,YAAY,EAEjD,QAAQ,EAAE,CAAC,CAAC,aAEZ,KAAC,QAAQ,IAAC,SAAS,EAAC,kCAAkC,GAAG,EACzD,cAAK,SAAS,EAAC,mCAAmC,0BAE5C,IACC,GACL,IACF,IACF,EACL,eAAe,CAAC,kBAAkB,KAAK,SAAS,IAAI,CACnD,KAAC,gCAAgC,IAC/B,MAAM,EAAE,eAAe,CAAC,kBAAkB,CAAC,KAAK,EAChD,eAAe,EAAE,YAAY,EAC7B,YAAY,EAAE,eAAe,CAAC,kBAAkB,GAChD,CACH,EACA,eAAe,CAAC,kBAAkB,KAAK,SAAS,IAAI,CACnD,eAAO,CACR,IACc,IACG,GAClB,GACS,IACG,CACvB,EACA,CAAC,eAAe,CAAC,UAAU,IAAI,CAC9B,KAAC,qBAAqB,IACpB,OAAO,EAAE,gBAAgB,EACzB,eAAe,EAAC,KAAK,EACrB,IAAI,EAAC,4BAA4B,EACjC,WAAW,EAAC,+BAA+B,EAC3C,gBAAgB,EAAE,oBAAoB,GACtC,CACH,IACG,GACQ,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC"}
package/lib/index.css CHANGED
@@ -1,4 +1,4 @@
1
- /** @license @finos/legend-application-studio v28.15.8
1
+ /** @license @finos/legend-application-studio v28.15.10
2
2
  * Copyright (c) 2020-present, Goldman Sachs
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "28.15.8",
3
+ "version": "28.15.10",
4
4
  "description": "Legend Studio application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -13,16 +13,20 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { type GeneratorFn } from '@finos/legend-shared';
16
+ import { type GeneratorFn, ActionState } from '@finos/legend-shared';
17
17
  import { editor as monacoEditorAPI } from 'monaco-editor';
18
18
  import { type Database, type PackageableConnection } from '@finos/legend-graph';
19
19
  import type { EditorStore } from '../EditorStore.js';
20
20
  import type { CommandRegistrar } from '@finos/legend-application';
21
21
  import { DatabaseSchemaExplorerState } from '../editor-state/element-editor-state/connection/DatabaseBuilderState.js';
22
+ export interface SQL_ExecutionResult {
23
+ value: string;
24
+ sqlDuration: number;
25
+ }
22
26
  export declare class SQLPlaygroundPanelState implements CommandRegistrar {
23
27
  readonly editorStore: EditorStore;
24
- isFetchingSchema: boolean;
25
- isExecutingRawSQL: boolean;
28
+ isFetchingSchema: ActionState;
29
+ executeRawSQLState: ActionState;
26
30
  connection?: PackageableConnection | undefined;
27
31
  database?: Database | undefined;
28
32
  schemaExplorerState?: DatabaseSchemaExplorerState | undefined;
@@ -30,17 +34,17 @@ export declare class SQLPlaygroundPanelState implements CommandRegistrar {
30
34
  sqlEditor?: monacoEditorAPI.IStandaloneCodeEditor | undefined;
31
35
  sqlEditorViewState?: monacoEditorAPI.ICodeEditorViewState | undefined;
32
36
  sqlText: string;
33
- sqlExecutionResult?: string | undefined;
34
- isBuildingDatabase: boolean;
35
- isUpdatingDatabase: boolean;
37
+ sqlExecutionResult?: SQL_ExecutionResult | undefined;
38
+ isLocalModeEnabled: boolean;
36
39
  constructor(editorStore: EditorStore);
37
40
  setConnection(val: PackageableConnection | undefined): void;
38
41
  setSQLText(val: string): void;
39
42
  setSQLEditor(val: monacoEditorAPI.IStandaloneCodeEditor | undefined): void;
40
- resetSQL(): void;
43
+ stopExecuteSQL(): void;
41
44
  setSQLEditorViewState(val: monacoEditorAPI.ICodeEditorViewState | undefined): void;
42
45
  registerCommands(): void;
43
46
  deregisterCommands(): void;
47
+ toggleIsLocalModeEnabled(): void;
44
48
  executeRawSQL(): GeneratorFn<void>;
45
49
  }
46
50
  //# sourceMappingURL=SQLPlaygroundPanelState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SQLPlaygroundPanelState.d.ts","sourceRoot":"","sources":["../../../../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C;IAC9D,kBAAkB,CAAC,EAAE,eAAe,CAAC,oBAAoB,GAAG,SAAS,CAAC;IACtE,OAAO,SAAoB;IAC3B,kBAAkB,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAErD,kBAAkB,UAAS;gBAEf,WAAW,EAAE,WAAW;IA4BpC,aAAa,CAAC,GAAG,EAAE,qBAAqB,GAAG,SAAS,GAAG,IAAI;IAgB3D,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAI7B,YAAY,CAAC,GAAG,EAAE,eAAe,CAAC,qBAAqB,GAAG,SAAS,GAAG,IAAI;IAW1E,cAAc,IAAI,IAAI;IAItB,qBAAqB,CACnB,GAAG,EAAE,eAAe,CAAC,oBAAoB,GAAG,SAAS,GACpD,IAAI;IAIP,gBAAgB,IAAI,IAAI;IAgBxB,kBAAkB,IAAI,IAAI;IAO1B,wBAAwB,IAAI,IAAI;IAK/B,aAAa,IAAI,WAAW,CAAC,IAAI,CAAC;CAsCpC"}
@@ -13,7 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { assertErrorThrown, LogEvent, getNullableLastEntry, } from '@finos/legend-shared';
16
+ import { assertErrorThrown, LogEvent, getNullableLastEntry, ActionState, } from '@finos/legend-shared';
17
17
  import { observable, makeObservable, flow, flowResult, action } from 'mobx';
18
18
  import { editor as monacoEditorAPI } from 'monaco-editor';
19
19
  import { guaranteeRelationalDatabaseConnection, GRAPH_MANAGER_EVENT, } from '@finos/legend-graph';
@@ -24,8 +24,8 @@ import { DatabaseSchemaExplorerState } from '../editor-state/element-editor-stat
24
24
  const DEFAULT_SQL_TEXT = `--Start building your SQL. Note that you can also drag-and-drop nodes from schema explorer\n`;
25
25
  export class SQLPlaygroundPanelState {
26
26
  editorStore;
27
- isFetchingSchema = false;
28
- isExecutingRawSQL = false;
27
+ isFetchingSchema = ActionState.create();
28
+ executeRawSQLState = ActionState.create();
29
29
  connection;
30
30
  database;
31
31
  schemaExplorerState;
@@ -34,20 +34,21 @@ export class SQLPlaygroundPanelState {
34
34
  sqlEditorViewState;
35
35
  sqlText = DEFAULT_SQL_TEXT;
36
36
  sqlExecutionResult;
37
- isBuildingDatabase = false;
38
- isUpdatingDatabase = false;
37
+ isLocalModeEnabled = false;
39
38
  constructor(editorStore) {
40
39
  makeObservable(this, {
41
40
  isFetchingSchema: observable,
42
- isExecutingRawSQL: observable,
41
+ executeRawSQLState: observable,
43
42
  connection: observable,
44
43
  database: observable,
45
44
  schemaExplorerState: observable,
46
45
  sqlText: observable,
47
- resetSQL: action,
46
+ isLocalModeEnabled: observable,
48
47
  sqlExecutionResult: observable,
49
48
  sqlEditor: observable.ref,
50
49
  sqlEditorViewState: observable.ref,
50
+ stopExecuteSQL: action,
51
+ toggleIsLocalModeEnabled: action,
51
52
  setConnection: action,
52
53
  setSQLEditor: action,
53
54
  setSQLEditorViewState: action,
@@ -83,9 +84,7 @@ export class SQLPlaygroundPanelState {
83
84
  });
84
85
  }
85
86
  }
86
- resetSQL() {
87
- this.setSQLText(DEFAULT_SQL_TEXT);
88
- this.sqlEditorTextModel.setValue(DEFAULT_SQL_TEXT);
87
+ stopExecuteSQL() {
89
88
  this.sqlExecutionResult = undefined;
90
89
  }
91
90
  setSQLEditorViewState(val) {
@@ -106,12 +105,16 @@ export class SQLPlaygroundPanelState {
106
105
  deregisterCommands() {
107
106
  [STO_RELATIONAL_LEGEND_STUDIO_COMMAND_KEY.SQL_PLAYGROUND_EXECUTE].forEach((key) => this.editorStore.applicationStore.commandService.deregisterCommand(key));
108
107
  }
108
+ toggleIsLocalModeEnabled() {
109
+ this.isLocalModeEnabled = !this.isLocalModeEnabled;
110
+ this.sqlExecutionResult = undefined;
111
+ }
109
112
  *executeRawSQL() {
110
- if (!this.connection || this.isExecutingRawSQL) {
113
+ if (!this.connection || this.executeRawSQLState.isInProgress) {
111
114
  return;
112
115
  }
113
116
  try {
114
- this.isExecutingRawSQL = true;
117
+ this.executeRawSQLState.inProgress();
115
118
  let sql = this.sqlText;
116
119
  const currentSelection = this.sqlEditor?.getSelection();
117
120
  if (currentSelection) {
@@ -120,8 +123,12 @@ export class SQLPlaygroundPanelState {
120
123
  sql = selectionValue;
121
124
  }
122
125
  }
123
- this.sqlExecutionResult =
124
- (yield this.editorStore.graphManagerState.graphManager.executeRawSQL(guaranteeRelationalDatabaseConnection(this.connection), sql));
126
+ const start = Date.now();
127
+ const value = (yield this.editorStore.graphManagerState.graphManager.executeRawSQL(guaranteeRelationalDatabaseConnection(this.connection), sql));
128
+ this.sqlExecutionResult = {
129
+ value: value,
130
+ sqlDuration: Date.now() - start,
131
+ };
125
132
  }
126
133
  catch (error) {
127
134
  assertErrorThrown(error);
@@ -129,7 +136,7 @@ export class SQLPlaygroundPanelState {
129
136
  this.editorStore.applicationStore.notificationService.notifyError(error);
130
137
  }
131
138
  finally {
132
- this.isExecutingRawSQL = false;
139
+ this.executeRawSQLState.complete();
133
140
  }
134
141
  }
135
142
  }
@@ -1 +1 @@
1
- {"version":3,"file":"SQLPlaygroundPanelState.js","sourceRoot":"","sources":["../../../../src/stores/editor/panel-group/SQLPlaygroundPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAGL,qCAAqC,EACrC,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,wCAAwC,EAAE,MAAM,wDAAwD,CAAC;AAClH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,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B;QAAC,OAAO,KAAK,EAAE;YACd,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAChD,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,EACtD,KAAK,CACN,CAAC;YACF,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC1E;gBAAS;YACR,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;SAChC;IACH,CAAC;CACF"}
1
+ {"version":3,"file":"SQLPlaygroundPanelState.js","sourceRoot":"","sources":["../../../../src/stores/editor/panel-group/SQLPlaygroundPanelState.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAEL,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,WAAW,GACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,EAGL,qCAAqC,EACrC,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,wCAAwC,EAAE,MAAM,wDAAwD,CAAC;AAClH,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,yEAAyE,CAAC;AAEtH,MAAM,gBAAgB,GAAG,8FAA8F,CAAC;AAOxH,MAAM,OAAO,uBAAuB;IACzB,WAAW,CAAc;IAElC,gBAAgB,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC;IACxC,kBAAkB,GAAG,WAAW,CAAC,MAAM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G,KAAK;aAChC,CAAC;SACH;QAAC,OAAO,KAAK,EAAE;YACd,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,UAAU,CAAC,KAAK,CAChD,QAAQ,CAAC,MAAM,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,EACtD,KAAK,CACN,CAAC;YACF,IAAI,CAAC,WAAW,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;SAC1E;gBAAS;YACR,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;SACpC;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-application-studio",
3
- "version": "28.15.8",
3
+ "version": "28.15.10",
4
4
  "description": "Legend Studio application core",
5
5
  "keywords": [
6
6
  "legend",
@@ -45,11 +45,11 @@
45
45
  "test:watch": "jest --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@finos/legend-application": "15.0.67",
49
- "@finos/legend-art": "7.1.19",
50
- "@finos/legend-graph": "31.8.3",
51
- "@finos/legend-lego": "1.2.8",
52
- "@finos/legend-query-builder": "4.14.8",
48
+ "@finos/legend-application": "15.0.69",
49
+ "@finos/legend-art": "7.1.21",
50
+ "@finos/legend-graph": "31.8.5",
51
+ "@finos/legend-lego": "1.2.10",
52
+ "@finos/legend-query-builder": "4.14.10",
53
53
  "@finos/legend-server-depot": "6.0.36",
54
54
  "@finos/legend-server-sdlc": "5.3.8",
55
55
  "@finos/legend-server-showcase": "0.2.5",
@@ -29,9 +29,11 @@ import {
29
29
  PlayIcon,
30
30
  PanelLoadingIndicator,
31
31
  BlankPanelContent,
32
- TrashIcon,
33
32
  PURE_DatabaseIcon,
34
33
  SyncIcon,
34
+ clsx,
35
+ CheckSquareIcon,
36
+ SquareIcon,
35
37
  } from '@finos/legend-art';
36
38
  import React, { useCallback, useEffect, useRef, useState } from 'react';
37
39
  import {
@@ -64,14 +66,23 @@ import {
64
66
  CORE_DND_TYPE,
65
67
  type ElementDragSource,
66
68
  } from '../../../stores/editor/utils/DnDUtils.js';
67
- import { DataGrid } from '@finos/legend-lego/data-grid';
69
+ import {
70
+ DataGrid,
71
+ type DataGridCellRendererParams,
72
+ type DataGridColumnDefinition,
73
+ type DataGridGetContextMenuItemsParams,
74
+ type DataGridMenuItemDef,
75
+ } from '@finos/legend-lego/data-grid';
68
76
  import {
69
77
  getNonNullableEntry,
70
78
  getNullableEntry,
71
79
  getNullableLastEntry,
72
80
  isNonNullable,
81
+ isNumber,
73
82
  isString,
83
+ isValidURL,
74
84
  parseCSVString,
85
+ prettyDuration,
75
86
  uniqBy,
76
87
  } from '@finos/legend-shared';
77
88
  import {
@@ -203,15 +214,6 @@ const PlaygroundSQLCodeEditor = observer(() => {
203
214
  IDisposable | undefined
204
215
  >(undefined);
205
216
 
206
- const executeRawSQL = (): void => {
207
- flowResult(playgroundState.executeRawSQL()).catch(
208
- applicationStore.alertUnhandledError,
209
- );
210
- };
211
- const reset = (): void => {
212
- playgroundState.resetSQL();
213
- };
214
-
215
217
  useEffect(() => {
216
218
  if (!editor && codeEditorRef.current) {
217
219
  const element = codeEditorRef.current;
@@ -340,28 +342,6 @@ const PlaygroundSQLCodeEditor = observer(() => {
340
342
 
341
343
  return (
342
344
  <div className="sql-playground__code-editor">
343
- <PanelLoadingIndicator isLoading={playgroundState.isExecutingRawSQL} />
344
- <div className="sql-playground__code-editor__header">
345
- <div className="sql-playground__code-editor__header__actions">
346
- <button
347
- className="sql-playground__code-editor__header__action"
348
- tabIndex={-1}
349
- onClick={executeRawSQL}
350
- disabled={playgroundState.isExecutingRawSQL}
351
- title="Execute (Ctrl + Enter)"
352
- >
353
- <PlayIcon />
354
- </button>
355
- <button
356
- className="sql-playground__code-editor__header__action"
357
- tabIndex={-1}
358
- onClick={reset}
359
- title="Reset"
360
- >
361
- <TrashIcon />
362
- </button>
363
- </div>
364
- </div>
365
345
  <PanelDropZone
366
346
  className="sql-playground__code-editor__content"
367
347
  isDragOver={isDatabaseNodeDragOver}
@@ -400,9 +380,39 @@ const parseExecutionResultData = (
400
380
  return undefined;
401
381
  };
402
382
 
383
+ const TDSResultCellRenderer = observer((params: DataGridCellRendererParams) => {
384
+ const cellValue = params.value as string;
385
+ const formattedCellValue = (): string => {
386
+ if (isNumber(cellValue)) {
387
+ return Intl.NumberFormat('en-US', {
388
+ maximumFractionDigits: 4,
389
+ }).format(Number(cellValue));
390
+ }
391
+ return cellValue;
392
+ };
393
+ const cellValueUrlLink =
394
+ isString(cellValue) && isValidURL(cellValue) ? cellValue : undefined;
395
+
396
+ return (
397
+ <div className={clsx('query-builder__result__values__table__cell')}>
398
+ {cellValueUrlLink ? (
399
+ <a href={cellValueUrlLink} target="_blank" rel="noreferrer">
400
+ {cellValueUrlLink}
401
+ </a>
402
+ ) : (
403
+ <span>{formattedCellValue()}</span>
404
+ )}
405
+ </div>
406
+ );
407
+ });
408
+
403
409
  const PlayGroundSQLExecutionResultGrid = observer(
404
- (props: { result: string }) => {
405
- const { result } = props;
410
+ (props: {
411
+ result: string;
412
+ useAdvancedGrid?: boolean;
413
+ useLocalMode?: boolean;
414
+ }) => {
415
+ const { result, useAdvancedGrid, useLocalMode } = props;
406
416
  const data = parseExecutionResultData(result);
407
417
 
408
418
  if (!data) {
@@ -410,6 +420,99 @@ const PlayGroundSQLExecutionResultGrid = observer(
410
420
  <BlankPanelContent>{`Can't parse result, displaying raw form:\n${result}`}</BlankPanelContent>
411
421
  );
412
422
  }
423
+ if (useAdvancedGrid) {
424
+ if (useLocalMode) {
425
+ const localcolDefs = data.columns.map(
426
+ (colName) =>
427
+ ({
428
+ minWidth: 50,
429
+ sortable: true,
430
+ resizable: true,
431
+ field: colName,
432
+ flex: 1,
433
+ enablePivot: true,
434
+ enableRowGroup: true,
435
+ enableValue: true,
436
+ allowedAggFuncs: ['count'],
437
+ }) as DataGridColumnDefinition,
438
+ );
439
+
440
+ return (
441
+ <DataGrid
442
+ rowData={data.rowData}
443
+ gridOptions={{
444
+ suppressScrollOnNewData: true,
445
+ rowSelection: 'multiple',
446
+ pivotPanelShow: 'always',
447
+ rowGroupPanelShow: 'always',
448
+ enableRangeSelection: true,
449
+ }}
450
+ // NOTE: when column definition changed, we need to force refresh the cell to make sure the cell renderer is updated
451
+ // See https://stackoverflow.com/questions/56341073/how-to-refresh-an-ag-grid-when-a-change-occurs-inside-a-custom-cell-renderer-com
452
+ onRowDataUpdated={(params) => {
453
+ params.api.refreshCells({ force: true });
454
+ }}
455
+ suppressFieldDotNotation={true}
456
+ suppressContextMenu={false}
457
+ columnDefs={localcolDefs}
458
+ sideBar={['columns', 'filters']}
459
+ />
460
+ );
461
+ }
462
+ const colDefs = data.columns.map(
463
+ (colName) =>
464
+ ({
465
+ minWidth: 50,
466
+ sortable: true,
467
+ resizable: true,
468
+ field: colName,
469
+ flex: 1,
470
+ cellRenderer: TDSResultCellRenderer,
471
+ filter: true,
472
+ }) as DataGridColumnDefinition,
473
+ );
474
+ const getContextMenuItems = useCallback(
475
+ (
476
+ params: DataGridGetContextMenuItemsParams<{
477
+ [key: string]: string;
478
+ }>,
479
+ ): (string | DataGridMenuItemDef)[] => [
480
+ 'copy',
481
+ 'copyWithHeaders',
482
+ {
483
+ name: 'Copy Row Value',
484
+ action: () => {
485
+ params.api.copySelectedRowsToClipboard();
486
+ },
487
+ },
488
+ ],
489
+ [],
490
+ );
491
+ return (
492
+ <div className="sql-playground__result__grid ag-theme-balham-dark">
493
+ <DataGrid
494
+ rowData={data.rowData}
495
+ overlayNoRowsTemplate={`<div class="sql-playground__result__grid--empty">No results</div>`}
496
+ gridOptions={{
497
+ suppressScrollOnNewData: true,
498
+ rowSelection: 'multiple',
499
+ enableRangeSelection: true,
500
+ }}
501
+ onRowDataUpdated={(params) => {
502
+ params.api.refreshCells({ force: true });
503
+ }}
504
+ suppressFieldDotNotation={true}
505
+ suppressClipboardPaste={false}
506
+ suppressContextMenu={false}
507
+ columnDefs={colDefs}
508
+ getContextMenuItems={(params): (string | DataGridMenuItemDef)[] =>
509
+ getContextMenuItems(params)
510
+ }
511
+ />
512
+ </div>
513
+ );
514
+ }
515
+
413
516
  return (
414
517
  <div className="sql-playground__result__grid ag-theme-balham-dark">
415
518
  <DataGrid
@@ -512,6 +615,26 @@ export const SQLPlaygroundPanel = observer(() => {
512
615
  }
513
616
  };
514
617
 
618
+ const executeRawSQL = (): void => {
619
+ flowResult(playgroundState.executeRawSQL()).catch(
620
+ applicationStore.alertUnhandledError,
621
+ );
622
+ };
623
+ const advancedMode = Boolean(
624
+ editorStore.applicationStore.config.options.queryBuilderConfig
625
+ ?.TEMPORARY__enableGridEnterpriseMode,
626
+ );
627
+ const resultDescription = playgroundState.sqlExecutionResult
628
+ ? `query ran in ${prettyDuration(
629
+ playgroundState.sqlExecutionResult.sqlDuration,
630
+ {
631
+ ms: true,
632
+ },
633
+ )}`
634
+ : undefined;
635
+ const toggleocalMode = (): void => {
636
+ playgroundState.toggleIsLocalModeEnabled();
637
+ };
515
638
  useEffect(() => {
516
639
  if (playgroundState.schemaExplorerState) {
517
640
  flowResult(
@@ -524,7 +647,6 @@ export const SQLPlaygroundPanel = observer(() => {
524
647
  LEGEND_STUDIO_APPLICATION_NAVIGATION_CONTEXT_KEY.SQL_PLAYGROUND,
525
648
  editorStore.activePanelMode === PANEL_MODE.SQL_PLAYGROUND,
526
649
  );
527
-
528
650
  return (
529
651
  <PanelDropZone
530
652
  isDragOver={isConnectionDragOver}
@@ -567,11 +689,7 @@ export const SQLPlaygroundPanel = observer(() => {
567
689
  />
568
690
  <button
569
691
  className="sql-playground__config__database-selector__update-btn btn--sm btn--dark"
570
- disabled={
571
- !playgroundState.database ||
572
- playgroundState.isBuildingDatabase ||
573
- playgroundState.isUpdatingDatabase
574
- }
692
+ disabled={!playgroundState.database}
575
693
  onClick={updateDatabase}
576
694
  title="Update database"
577
695
  >
@@ -580,6 +698,11 @@ export const SQLPlaygroundPanel = observer(() => {
580
698
  </div>
581
699
  </div>
582
700
  <div className="sql-playground__config__schema-explorer">
701
+ <PanelLoadingIndicator
702
+ isLoading={Boolean(
703
+ playgroundState.schemaExplorerState?.isGeneratingDatabase,
704
+ )}
705
+ />
583
706
  {playgroundState.schemaExplorerState?.treeData && (
584
707
  <DatabaseSchemaExplorer
585
708
  treeData={playgroundState.schemaExplorerState.treeData}
@@ -603,9 +726,70 @@ export const SQLPlaygroundPanel = observer(() => {
603
726
  <ResizablePanelSplitterLine color="var(--color-dark-grey-250)" />
604
727
  </ResizablePanelSplitter>
605
728
  <ResizablePanel size={300}>
729
+ <div className="panel__header">
730
+ <div className="panel__header__title">
731
+ <div className="panel__header__title__label">
732
+ result
733
+ </div>
734
+
735
+ {playgroundState.executeRawSQLState.isInProgress && (
736
+ <div className="panel__header__title__label__status">
737
+ Running SQL...
738
+ </div>
739
+ )}
740
+
741
+ <div className="query-builder__result__analytics">
742
+ {resultDescription ?? ''}
743
+ </div>
744
+ </div>
745
+ <div className="panel__header__actions query-builder__result__header__actions">
746
+ {advancedMode && (
747
+ <div className="query-builder__result__advanced__mode">
748
+ <div className="query-builder__result__advanced__mode__label">
749
+ Local Mode
750
+ </div>
751
+ <button
752
+ className={clsx(
753
+ 'query-builder__result__advanced__mode__toggler__btn',
754
+ {
755
+ 'query-builder__result__advanced__mode__toggler__btn--toggled':
756
+ playgroundState.isLocalModeEnabled,
757
+ },
758
+ )}
759
+ onClick={toggleocalMode}
760
+ tabIndex={-1}
761
+ >
762
+ {playgroundState.isLocalModeEnabled ? (
763
+ <CheckSquareIcon />
764
+ ) : (
765
+ <SquareIcon />
766
+ )}
767
+ </button>
768
+ </div>
769
+ )}
770
+
771
+ <div className="query-builder__result__execute-btn btn__dropdown-combo btn__dropdown-combo--primary">
772
+ <button
773
+ className="btn__dropdown-combo__label"
774
+ onClick={executeRawSQL}
775
+ disabled={
776
+ playgroundState.executeRawSQLState.isInProgress
777
+ }
778
+ tabIndex={-1}
779
+ >
780
+ <PlayIcon className="btn__dropdown-combo__label__icon" />
781
+ <div className="btn__dropdown-combo__label__title">
782
+ Run Query
783
+ </div>
784
+ </button>
785
+ </div>
786
+ </div>
787
+ </div>
606
788
  {playgroundState.sqlExecutionResult !== undefined && (
607
789
  <PlayGroundSQLExecutionResultGrid
608
- result={playgroundState.sqlExecutionResult}
790
+ result={playgroundState.sqlExecutionResult.value}
791
+ useAdvancedGrid={advancedMode}
792
+ useLocalMode={playgroundState.isLocalModeEnabled}
609
793
  />
610
794
  )}
611
795
  {playgroundState.sqlExecutionResult === undefined && (
@@ -19,6 +19,7 @@ import {
19
19
  assertErrorThrown,
20
20
  LogEvent,
21
21
  getNullableLastEntry,
22
+ ActionState,
22
23
  } from '@finos/legend-shared';
23
24
  import { observable, makeObservable, flow, flowResult, action } from 'mobx';
24
25
  import { editor as monacoEditorAPI } from 'monaco-editor';
@@ -40,11 +41,16 @@ import { DatabaseSchemaExplorerState } from '../editor-state/element-editor-stat
40
41
 
41
42
  const DEFAULT_SQL_TEXT = `--Start building your SQL. Note that you can also drag-and-drop nodes from schema explorer\n`;
42
43
 
44
+ export interface SQL_ExecutionResult {
45
+ value: string;
46
+ sqlDuration: number;
47
+ }
48
+
43
49
  export class SQLPlaygroundPanelState implements CommandRegistrar {
44
50
  readonly editorStore: EditorStore;
45
51
 
46
- isFetchingSchema = false;
47
- isExecutingRawSQL = false;
52
+ isFetchingSchema = ActionState.create();
53
+ executeRawSQLState = ActionState.create();
48
54
 
49
55
  connection?: PackageableConnection | undefined;
50
56
  database?: Database | undefined;
@@ -54,23 +60,24 @@ export class SQLPlaygroundPanelState implements CommandRegistrar {
54
60
  sqlEditor?: monacoEditorAPI.IStandaloneCodeEditor | undefined;
55
61
  sqlEditorViewState?: monacoEditorAPI.ICodeEditorViewState | undefined;
56
62
  sqlText = DEFAULT_SQL_TEXT;
57
- sqlExecutionResult?: string | undefined;
63
+ sqlExecutionResult?: SQL_ExecutionResult | undefined;
58
64
 
59
- isBuildingDatabase = false;
60
- isUpdatingDatabase = false;
65
+ isLocalModeEnabled = false;
61
66
 
62
67
  constructor(editorStore: EditorStore) {
63
68
  makeObservable(this, {
64
69
  isFetchingSchema: observable,
65
- isExecutingRawSQL: observable,
70
+ executeRawSQLState: observable,
66
71
  connection: observable,
67
72
  database: observable,
68
73
  schemaExplorerState: observable,
69
74
  sqlText: observable,
70
- resetSQL: action,
75
+ isLocalModeEnabled: observable,
71
76
  sqlExecutionResult: observable,
72
77
  sqlEditor: observable.ref,
73
78
  sqlEditorViewState: observable.ref,
79
+ stopExecuteSQL: action,
80
+ toggleIsLocalModeEnabled: action,
74
81
  setConnection: action,
75
82
  setSQLEditor: action,
76
83
  setSQLEditorViewState: action,
@@ -116,9 +123,7 @@ export class SQLPlaygroundPanelState implements CommandRegistrar {
116
123
  }
117
124
  }
118
125
 
119
- resetSQL(): void {
120
- this.setSQLText(DEFAULT_SQL_TEXT);
121
- this.sqlEditorTextModel.setValue(DEFAULT_SQL_TEXT);
126
+ stopExecuteSQL(): void {
122
127
  this.sqlExecutionResult = undefined;
123
128
  }
124
129
 
@@ -151,13 +156,18 @@ export class SQLPlaygroundPanelState implements CommandRegistrar {
151
156
  );
152
157
  }
153
158
 
159
+ toggleIsLocalModeEnabled(): void {
160
+ this.isLocalModeEnabled = !this.isLocalModeEnabled;
161
+ this.sqlExecutionResult = undefined;
162
+ }
163
+
154
164
  *executeRawSQL(): GeneratorFn<void> {
155
- if (!this.connection || this.isExecutingRawSQL) {
165
+ if (!this.connection || this.executeRawSQLState.isInProgress) {
156
166
  return;
157
167
  }
158
168
 
159
169
  try {
160
- this.isExecutingRawSQL = true;
170
+ this.executeRawSQLState.inProgress();
161
171
 
162
172
  let sql = this.sqlText;
163
173
  const currentSelection = this.sqlEditor?.getSelection();
@@ -168,12 +178,16 @@ export class SQLPlaygroundPanelState implements CommandRegistrar {
168
178
  sql = selectionValue;
169
179
  }
170
180
  }
171
-
172
- this.sqlExecutionResult =
181
+ const start = Date.now();
182
+ const value =
173
183
  (yield this.editorStore.graphManagerState.graphManager.executeRawSQL(
174
184
  guaranteeRelationalDatabaseConnection(this.connection),
175
185
  sql,
176
186
  )) as string;
187
+ this.sqlExecutionResult = {
188
+ value: value,
189
+ sqlDuration: Date.now() - start,
190
+ };
177
191
  } catch (error) {
178
192
  assertErrorThrown(error);
179
193
  this.editorStore.applicationStore.logService.error(
@@ -182,7 +196,7 @@ export class SQLPlaygroundPanelState implements CommandRegistrar {
182
196
  );
183
197
  this.editorStore.applicationStore.notificationService.notifyError(error);
184
198
  } finally {
185
- this.isExecutingRawSQL = false;
199
+ this.executeRawSQLState.complete();
186
200
  }
187
201
  }
188
202
  }