dbeaver/pro#6229 execute sql via cli (#3721)

* dbeaver/pro#6229 execute sql via cli

* dbeaver/pro#6229 review fix

* dbeaver/pro#6229 update run scripts

---------

Co-authored-by: MashaKorax <84867187+MashaKorax@users.noreply.github.com>
This commit is contained in:
Alexander Skoblikov
2025-09-23 18:48:26 +02:00
committed by GitHub
co-authored by MashaKorax
parent 37b8716aee
commit 97d179a103
5 changed files with 13 additions and 15 deletions
+1 -1
View File
@@ -36,6 +36,6 @@ exec java ${JAVA_OPTS} \
-jar ${launcherJar} \
-product io.cloudbeaver.product.ce.product \
-web-config conf/cloudbeaver.conf \
${CLI_OPTS} \
"$@" \
-nl en \
-registryMultiLanguage
+4 -3
View File
@@ -1,8 +1,9 @@
#!/bin/bash
set -Eeo pipefail
CLI_OPTS="$@"
if [[ $# -eq 0 ]] ;
then
CLI_OPTS='-help'
set -- "$@" -help
fi
source run-server.sh
set -- "$@" -cli-mode
source run-server.sh "$@"
@@ -20,7 +20,7 @@ import org.apache.commons.cli.CommandLine;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.model.cli.ApplicationInstanceController;
import org.jkiss.dbeaver.model.cli.ApplicationInstanceServer;
import org.jkiss.dbeaver.model.cli.CliProcessResult;
import org.jkiss.dbeaver.model.cli.CLIProcessResult;
import java.io.IOException;
@@ -31,7 +31,7 @@ public class CloudBeaverInstanceServer extends ApplicationInstanceServer<Applica
@NotNull
@Override
public CliProcessResult handleCommandLine(@NotNull String[] args) {
public CLIProcessResult handleCommandLine(@NotNull String[] args) {
CommandLine cmd = CloudBeaverCommandLine.getInstance().getCommandLine(args);
try {
return CloudBeaverCommandLine.getInstance().executeCommandLineCommands(
@@ -40,7 +40,7 @@ public class CloudBeaverInstanceServer extends ApplicationInstanceServer<Applica
false
);
} catch (Exception e) {
return new CliProcessResult(CliProcessResult.PostAction.ERROR, "Error executing command: " + e.getMessage());
return new CLIProcessResult(CLIProcessResult.PostAction.ERROR, "Error executing command: " + e.getMessage());
}
}
}
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
* Copyright (C) 2010-2025 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.
@@ -53,7 +53,7 @@ public class WebDataTransferStreamProcessor {
@Property
public String getFileExtension() {
return WebDataTransferUtils.getProcessorFileExtension(processor);
return processor.getProcessorFileExtension();
}
@Property
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
* Copyright (C) 2010-2025 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.
@@ -19,7 +19,6 @@ package io.cloudbeaver.service.data.transfer.impl;
import io.cloudbeaver.model.session.WebSession;
import org.jkiss.code.NotNull;
import org.jkiss.dbeaver.Log;
import org.jkiss.dbeaver.model.preferences.DBPPropertyDescriptor;
import org.jkiss.dbeaver.tools.transfer.registry.DataTransferProcessorDescriptor;
import org.jkiss.utils.CommonUtils;
@@ -32,9 +31,7 @@ class WebDataTransferUtils {
public static String getProcessorFileExtension(DataTransferProcessorDescriptor processor) {
DBPPropertyDescriptor extProperty = processor.getProperty("extension");
String ext = extProperty == null ? processor.getAppFileExtension() : CommonUtils.toString(extProperty.getDefaultValue(), null);
return CommonUtils.isEmpty(ext) ? "data" : ext;
return processor.getProcessorFileExtension();
}
public static String getProcessorFileExtension(DataTransferProcessorDescriptor processor, Map<String, Object> processorProperties) {
@@ -42,7 +39,7 @@ class WebDataTransferUtils {
return CommonUtils.toString(processorProperties.get(EXTENSION), "data");
}
return getProcessorFileExtension(processor);
return processor.getProcessorFileExtension();
}
public static String normalizeFileName(