From 90fcbe6b7fb45265eb96f57be0605bb5b0d8a384 Mon Sep 17 00:00:00 2001 From: Alexey Potsetsuev Date: Thu, 22 Jan 2026 00:18:25 +0800 Subject: [PATCH] dbeaver/pro#7854 feat: display query with parameters (#4064) * dbeaver/pro#7854 feat: display query with parameters * fix: use replaceAll instead of replace * dbeaver/pro#7854 fix: support parameters and variables --------- Co-authored-by: Daria Marutkina <125263541+dariamarutkina@users.noreply.github.com> --- .../src/CommonDialog/ConfirmationDialog.tsx | 6 +- .../package.json | 2 +- .../DataViewerRequestQueryViewerDialog.tsx | 6 +- .../tsconfig.json | 4 +- .../package.json | 2 +- .../QueryDetailsDialog.tsx | 8 +- .../tsconfig.json | 2 +- .../packages/plugin-ddl-viewer/package.json | 2 +- .../src/DdlViewer/DDLViewerTabPanel.tsx | 6 +- .../ExtendedDDLViewerTabPanel.tsx | 6 +- .../packages/plugin-ddl-viewer/tsconfig.json | 4 +- .../package.json | 2 +- .../src/renderQueryForConfirmation.tsx | 8 +- .../tsconfig.json | 2 +- .../plugin-sql-editor-codemirror/.gitignore | 18 +++++ .../plugin-sql-editor-codemirror/package.json | 42 ++++++++++ .../src}/ACTIVE_QUERY_EXTENSION.ts | 0 .../src}/QUERY_STATUS_GUTTER_EXTENSION.ts | 0 .../src}/SQLCodeEditor/SQLCodeEditor.tsx | 0 .../src/SQLCodeEditor/SQLCodeEditorLoader.ts} | 4 +- .../src}/SQLCodeEditor/useSQLCodeEditor.ts | 0 .../plugin-sql-editor-codemirror/src/index.ts | 13 ++++ .../src}/useSqlDialectExtension.ts | 4 +- .../tsconfig.json | 34 ++++++++ .../plugin-sql-editor-new/package.json | 1 + .../SQLCodeEditorPanel/SQLCodeEditorPanel.tsx | 18 +++-- .../useSQLCodeEditorPanel.ts | 14 ++-- .../plugin-sql-editor-new/src/index.ts | 4 +- .../plugin-sql-editor-new/tsconfig.json | 3 + .../packages/plugin-sql-editor/package.json | 1 + .../plugin-sql-editor/src/QueryDataSource.ts | 12 ++- .../src/SqlEditorSettingsService.ts | 12 ++- .../src/renderQueryParamsForConfirmation.tsx | 77 +++++++++++++++---- .../packages/plugin-sql-editor/tsconfig.json | 3 + .../plugin-sql-generator/package.json | 2 +- .../src/ScriptPreview/ScriptPreviewDialog.tsx | 12 +-- .../src/SqlGenerators/GeneratedSqlDialog.tsx | 6 +- .../plugin-sql-generator/tsconfig.json | 2 +- webapp/yarn.lock | 33 ++++++-- 39 files changed, 286 insertions(+), 89 deletions(-) create mode 100644 webapp/packages/plugin-sql-editor-codemirror/.gitignore create mode 100644 webapp/packages/plugin-sql-editor-codemirror/package.json rename webapp/packages/{plugin-sql-editor-new/src/SQLEditor => plugin-sql-editor-codemirror/src}/ACTIVE_QUERY_EXTENSION.ts (100%) rename webapp/packages/{plugin-sql-editor-new/src/SQLEditor => plugin-sql-editor-codemirror/src}/QUERY_STATUS_GUTTER_EXTENSION.ts (100%) rename webapp/packages/{plugin-sql-editor-new/src/SQLEditor => plugin-sql-editor-codemirror/src}/SQLCodeEditor/SQLCodeEditor.tsx (100%) rename webapp/packages/{plugin-sql-editor-new/src/SQLEditor/SQLCodeEditor/SQLCodeEditorLoader.tsx => plugin-sql-editor-codemirror/src/SQLCodeEditor/SQLCodeEditorLoader.ts} (57%) rename webapp/packages/{plugin-sql-editor-new/src/SQLEditor => plugin-sql-editor-codemirror/src}/SQLCodeEditor/useSQLCodeEditor.ts (100%) create mode 100644 webapp/packages/plugin-sql-editor-codemirror/src/index.ts rename webapp/packages/{plugin-sql-editor-new/src/SQLEditor => plugin-sql-editor-codemirror/src}/useSqlDialectExtension.ts (93%) create mode 100644 webapp/packages/plugin-sql-editor-codemirror/tsconfig.json diff --git a/webapp/packages/core-blocks/src/CommonDialog/ConfirmationDialog.tsx b/webapp/packages/core-blocks/src/CommonDialog/ConfirmationDialog.tsx index 71d602a353..ef9655973d 100644 --- a/webapp/packages/core-blocks/src/CommonDialog/ConfirmationDialog.tsx +++ b/webapp/packages/core-blocks/src/CommonDialog/ConfirmationDialog.tsx @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2025 DBeaver Corp and others + * Copyright (C) 2020-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -31,6 +31,7 @@ export interface ConfirmationDialogPayload { showSkipConfirmations?: boolean; showExtraAction?: boolean; bigIcon?: boolean; + noOverflow?: boolean; viewBox?: string; message: TLocalizationToken; confirmActionText?: TLocalizationToken; @@ -60,6 +61,7 @@ export const ConfirmationDialog: DialogComponent - + {children && children?.()} diff --git a/webapp/packages/plugin-data-viewer-request-query-viewer/package.json b/webapp/packages/plugin-data-viewer-request-query-viewer/package.json index 3c01c55da0..c9a5a408d9 100644 --- a/webapp/packages/plugin-data-viewer-request-query-viewer/package.json +++ b/webapp/packages/plugin-data-viewer-request-query-viewer/package.json @@ -34,8 +34,8 @@ "@cloudbeaver/plugin-codemirror6": "workspace:*", "@cloudbeaver/plugin-data-viewer": "workspace:*", "@cloudbeaver/plugin-sql-editor": "workspace:*", + "@cloudbeaver/plugin-sql-editor-codemirror": "workspace:*", "@cloudbeaver/plugin-sql-editor-navigation-tab": "workspace:*", - "@cloudbeaver/plugin-sql-editor-new": "workspace:*", "@dbeaver/js-helpers": "workspace:*", "@dbeaver/ui-kit": "workspace:*", "mobx": "^6", diff --git a/webapp/packages/plugin-data-viewer-request-query-viewer/src/DataViewerRequestQueryViewerDialog.tsx b/webapp/packages/plugin-data-viewer-request-query-viewer/src/DataViewerRequestQueryViewerDialog.tsx index e5f2de01f7..165c0bd7eb 100644 --- a/webapp/packages/plugin-data-viewer-request-query-viewer/src/DataViewerRequestQueryViewerDialog.tsx +++ b/webapp/packages/plugin-data-viewer-request-query-viewer/src/DataViewerRequestQueryViewerDialog.tsx @@ -1,6 +1,6 @@ /* * CloudBeaver - Cloud Database Manager - * Copyright (C) 2020-2025 DBeaver Corp and others + * Copyright (C) 2020-2026 DBeaver Corp and others * * Licensed under the Apache License, Version 2.0. * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import type { DialogComponent } from '@cloudbeaver/core-dialogs'; import { useService } from '@cloudbeaver/core-di'; import { useCodemirrorExtensions } from '@cloudbeaver/plugin-codemirror6'; import { LocalStorageSqlDataSource } from '@cloudbeaver/plugin-sql-editor'; -import { SQLCodeEditorLoader, useSqlDialectExtension } from '@cloudbeaver/plugin-sql-editor-new'; +import { SQLCodeEditor, useSqlDialectExtension } from '@cloudbeaver/plugin-sql-editor-codemirror'; import { ConnectionDialectResource, ConnectionInfoResource, type IConnectionInfoParams } from '@cloudbeaver/core-connections'; import { NavNodeManagerService, NodeManagerUtils } from '@cloudbeaver/core-navigation-tree'; import { SqlEditorNavigatorService } from '@cloudbeaver/plugin-sql-editor-navigation-tab'; @@ -67,7 +67,7 @@ export const DataViewerRequestQueryViewerDialog: DialogComponent = obs - +