From e5238f0d4aa99549ff85ba72ccd0ff41cf9bb399 Mon Sep 17 00:00:00 2001 From: IvanGorshechnikov Date: Wed, 28 Oct 2026 15:04:36 +0100 Subject: [PATCH 1/3] dbeaver/pro#11258 Approve H2 initialization SQL by default in dbvr --- bundles/org.dbvr.cli/META-INF/MANIFEST.MF | 3 +- bundles/org.dbvr.cli/plugin.xml | 3 ++ .../service/CLIServiceH2InitConfirmation.java | 28 +++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceH2InitConfirmation.java diff --git a/bundles/org.dbvr.cli/META-INF/MANIFEST.MF b/bundles/org.dbvr.cli/META-INF/MANIFEST.MF index 79157671..34e4b1a0 100644 --- a/bundles/org.dbvr.cli/META-INF/MANIFEST.MF +++ b/bundles/org.dbvr.cli/META-INF/MANIFEST.MF @@ -9,7 +9,8 @@ Bundle-ActivationPolicy: lazy Bundle-Activator: org.dbvr.cli.app.CLIActivator Bundle-RequiredExecutionEnvironment: JavaSE-21 Require-Bundle: org.jkiss.dbeaver.model.cli;visibility:=reexport, - org.jkiss.dbeaver.registry;visibility:=reexport + org.jkiss.dbeaver.registry;visibility:=reexport, + org.jkiss.dbeaver.ext.h2 Export-Package: org.dbvr.cli.app, org.dbvr.cli.command.datasource Automatic-Module-Name: org.dbvr.app.ce diff --git a/bundles/org.dbvr.cli/plugin.xml b/bundles/org.dbvr.cli/plugin.xml index 328ac284..4c54acb3 100644 --- a/bundles/org.dbvr.cli/plugin.xml +++ b/bundles/org.dbvr.cli/plugin.xml @@ -15,5 +15,8 @@ + diff --git a/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceH2InitConfirmation.java b/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceH2InitConfirmation.java new file mode 100644 index 00000000..cc992a09 --- /dev/null +++ b/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceH2InitConfirmation.java @@ -0,0 +1,28 @@ +/* + * DBeaver - Universal Database Manager + * Copyright (C) 2010-2026 DBeaver Corp and others + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.dbvr.cli.service; + +import org.jkiss.code.NotNull; +import org.jkiss.dbeaver.ext.h2.util.H2InitConfirmation; +import org.jkiss.dbeaver.model.DBPDataSourceContainer; + +public class CLIServiceH2InitConfirmation implements H2InitConfirmation { + @Override + public boolean confirmInitScript(@NotNull DBPDataSourceContainer container, @NotNull String script) { + return true; + } +} From e111af7436c5b752c81d4beb945e1a4339e9c8bb Mon Sep 17 00:00:00 2001 From: IvanGorshechnikov Date: Wed, 28 Oct 2026 15:13:37 +0100 Subject: [PATCH 2/3] dbeaver/pro#11258 Remove CLI dependency on H2 initialization API --- bundles/org.dbvr.cli/META-INF/MANIFEST.MF | 3 +-- bundles/org.dbvr.cli/plugin.xml | 4 ++-- ...eH2InitConfirmation.java => CLIServiceConnectionInit.java} | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) rename bundles/org.dbvr.cli/src/org/dbvr/cli/service/{CLIServiceH2InitConfirmation.java => CLIServiceConnectionInit.java} (87%) diff --git a/bundles/org.dbvr.cli/META-INF/MANIFEST.MF b/bundles/org.dbvr.cli/META-INF/MANIFEST.MF index 34e4b1a0..79157671 100644 --- a/bundles/org.dbvr.cli/META-INF/MANIFEST.MF +++ b/bundles/org.dbvr.cli/META-INF/MANIFEST.MF @@ -9,8 +9,7 @@ Bundle-ActivationPolicy: lazy Bundle-Activator: org.dbvr.cli.app.CLIActivator Bundle-RequiredExecutionEnvironment: JavaSE-21 Require-Bundle: org.jkiss.dbeaver.model.cli;visibility:=reexport, - org.jkiss.dbeaver.registry;visibility:=reexport, - org.jkiss.dbeaver.ext.h2 + org.jkiss.dbeaver.registry;visibility:=reexport Export-Package: org.dbvr.cli.app, org.dbvr.cli.command.datasource Automatic-Module-Name: org.dbvr.app.ce diff --git a/bundles/org.dbvr.cli/plugin.xml b/bundles/org.dbvr.cli/plugin.xml index 4c54acb3..9dce8444 100644 --- a/bundles/org.dbvr.cli/plugin.xml +++ b/bundles/org.dbvr.cli/plugin.xml @@ -15,8 +15,8 @@ - diff --git a/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceH2InitConfirmation.java b/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceConnectionInit.java similarity index 87% rename from bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceH2InitConfirmation.java rename to bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceConnectionInit.java index cc992a09..34ee6b4f 100644 --- a/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceH2InitConfirmation.java +++ b/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceConnectionInit.java @@ -17,10 +17,10 @@ package org.dbvr.cli.service; import org.jkiss.code.NotNull; -import org.jkiss.dbeaver.ext.h2.util.H2InitConfirmation; import org.jkiss.dbeaver.model.DBPDataSourceContainer; +import org.jkiss.dbeaver.runtime.ui.UIServiceConnectionInit; -public class CLIServiceH2InitConfirmation implements H2InitConfirmation { +public class CLIServiceConnectionInit implements UIServiceConnectionInit { @Override public boolean confirmInitScript(@NotNull DBPDataSourceContainer container, @NotNull String script) { return true; From f2bd90c464eda41548796312b3bba72ed6adc3c5 Mon Sep 17 00:00:00 2001 From: IvanGorshechnikov Date: Wed, 28 Oct 2026 16:26:59 +0100 Subject: [PATCH 3/3] dbeaver/pro#11258 Pass connection URL to initialization approval service --- .../src/org/dbvr/cli/service/CLIServiceConnectionInit.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceConnectionInit.java b/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceConnectionInit.java index 34ee6b4f..3daf4d72 100644 --- a/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceConnectionInit.java +++ b/bundles/org.dbvr.cli/src/org/dbvr/cli/service/CLIServiceConnectionInit.java @@ -17,12 +17,13 @@ package org.dbvr.cli.service; import org.jkiss.code.NotNull; +import org.jkiss.code.Nullable; import org.jkiss.dbeaver.model.DBPDataSourceContainer; import org.jkiss.dbeaver.runtime.ui.UIServiceConnectionInit; public class CLIServiceConnectionInit implements UIServiceConnectionInit { @Override - public boolean confirmInitScript(@NotNull DBPDataSourceContainer container, @NotNull String script) { + public boolean confirmInitScript(@NotNull DBPDataSourceContainer container, @Nullable String url, @NotNull String script) { return true; } }