mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
CB-779 athena db use provider property for s3 location (#1077)
This commit is contained in:
@@ -198,6 +198,7 @@ type DriverInfo {
|
||||
embedded: Boolean
|
||||
enabled: Boolean!
|
||||
requiresServerName: Boolean
|
||||
requiresDatabaseName: Boolean
|
||||
|
||||
licenseRequired: Boolean
|
||||
license: String
|
||||
|
||||
@@ -169,7 +169,6 @@ public class WebServiceUtils extends WebCommonUtils {
|
||||
if (config.getServerName() != null) {
|
||||
dsConfig.setServerName(config.getServerName());
|
||||
}
|
||||
dsConfig.setUrl(driver.getConnectionURL(dsConfig));
|
||||
}
|
||||
if (config.getProperties() != null) {
|
||||
Map<String, String> newProps = new LinkedHashMap<>();
|
||||
@@ -197,6 +196,9 @@ public class WebServiceUtils extends WebCommonUtils {
|
||||
if (config.getConfigurationType() != null) {
|
||||
dsConfig.setConfigurationType(config.getConfigurationType());
|
||||
}
|
||||
if (CommonUtils.isEmpty(config.getUrl())) {
|
||||
dsConfig.setUrl(driver.getConnectionURL(dsConfig));
|
||||
}
|
||||
// Save network handlers
|
||||
if (config.getNetworkHandlersConfig() != null) {
|
||||
for (WebNetworkHandlerConfigInput nhc : config.getNetworkHandlersConfig()) {
|
||||
|
||||
+10
@@ -44,6 +44,7 @@ import java.util.Map;
|
||||
public class WebDatabaseDriverConfig {
|
||||
|
||||
public static final String URL_SERVER_FIELD = "{server}";
|
||||
public static final String URL_DATABASE_FIELD = ".*(?:\\{(?:database|file|folder)}).*";
|
||||
private final WebSession webSession;
|
||||
private final DBPDriver driver;
|
||||
private String id;
|
||||
@@ -249,4 +250,13 @@ public class WebDatabaseDriverConfig {
|
||||
public DBPDriverConfigurationType[] getConfigurationTypes() {
|
||||
return driver.getSupportedConfigurationTypes().toArray(DBPDriverConfigurationType[]::new);
|
||||
}
|
||||
|
||||
|
||||
@Property
|
||||
public boolean getRequiresDatabaseName() {
|
||||
if (driver.getSampleURL() == null) {
|
||||
return false;
|
||||
}
|
||||
return driver.getSampleURL().matches(URL_DATABASE_FIELD);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user