CB-1949 add requiresServerName to the gql schema (#780)

* CB-1949 add requiresServerName to the gql schema

* CB-1949 add requiresServerName to the gql schema
This commit is contained in:
Ainur
2022-04-22 11:12:19 +03:00
committed by GitHub
parent 91ec60a924
commit abb2355c87
2 changed files with 10 additions and 0 deletions
@@ -194,6 +194,7 @@ type DriverInfo {
driverPropertiesURL: String
embedded: Boolean
enabled: Boolean!
requiresServerName: Boolean
# this fields must be removed and be replaced by DriverAuthModel
allowsEmptyPassword: Boolean @deprecated
@@ -42,6 +42,7 @@ import java.util.Map;
*/
public class WebDatabaseDriverConfig {
public static final String URL_SERVER_FIELD = "{server}";
private final WebSession webSession;
private final DBPDriver driver;
private String id;
@@ -239,4 +240,12 @@ public class WebDatabaseDriverConfig {
public boolean isEnabled() {
return ConfigurationUtils.isDriverEnabled(driver);
}
@Property
public boolean getRequiresServerName() {
if (driver.getSampleURL() == null) {
return false;
}
return driver.getSampleURL().contains(URL_SERVER_FIELD);
}
}