Skip to content

Commit

Permalink
#20602 remove excessive changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Destrolaric committed Jan 23, 2024
1 parent ce5036f commit be630c6
Showing 1 changed file with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@
*/
package org.jkiss.dbeaver.ext.postgresql.model;

import java.io.IOException;
import java.nio.file.Path;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.ZoneId;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
Expand Down Expand Up @@ -56,7 +45,6 @@
import org.jkiss.dbeaver.model.impl.sql.QueryTransformerLimit;
import org.jkiss.dbeaver.model.meta.ForTest;
import org.jkiss.dbeaver.model.net.DBWHandlerConfiguration;
import org.jkiss.dbeaver.model.preferences.DBPPreferenceStore;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.sql.SQLState;
import org.jkiss.dbeaver.model.struct.*;
Expand All @@ -68,6 +56,17 @@
import org.jkiss.utils.BeanUtils;
import org.jkiss.utils.CommonUtils;

import java.io.IOException;
import java.nio.file.Path;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.ZoneId;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* PostgreDataSource
*/
Expand Down Expand Up @@ -185,6 +184,7 @@ protected void initializeRemoteInstance(@NotNull DBRProgressMonitor monitor) thr
// ignore
}
}

private void loadAvailableDatabases(@NotNull DBRProgressMonitor monitor, DBPConnectionConfiguration configuration, List<PostgreDatabase> dbList) throws DBException {
DBExecUtils.startContextInitiation(getContainer());
try (Connection bootstrapConnection = openConnection(monitor, null, "Read PostgreSQL database list")) {
Expand Down Expand Up @@ -235,8 +235,7 @@ protected PreparedStatement prepareReadDatabaseListStatement(
String connectionDBName = getContainer().getConnectionConfiguration().getDatabaseName();
{
final boolean showTemplates = CommonUtils.toBoolean(configuration.getProviderProperty(PostgreConstants.PROP_SHOW_TEMPLATES_DB));
final boolean showUnavailable =
CommonUtils.toBoolean(configuration.getProviderProperty(PostgreConstants.PROP_SHOW_UNAVAILABLE_DB));
final boolean showUnavailable = CommonUtils.toBoolean(configuration.getProviderProperty(PostgreConstants.PROP_SHOW_UNAVAILABLE_DB));

if (!showUnavailable) {
catalogQuery.append(" AND datallowconn");
Expand Down Expand Up @@ -309,8 +308,7 @@ protected Map<String, String> getInternalConnectionProperties(
}
PostgreServerType serverType = getType();
if (serverType.turnOffPreparedStatements()
&& !CommonUtils.toBoolean(
getContainer().getActualConnectionConfiguration().getProviderProperty(PostgreConstants.PROP_USE_PREPARED_STATEMENTS))) {
&& !CommonUtils.toBoolean(getContainer().getActualConnectionConfiguration().getProviderProperty(PostgreConstants.PROP_USE_PREPARED_STATEMENTS))) {
// Turn off prepared statements using, to avoid error: "ERROR: prepared statement "S_1" already exists" from PGBouncer #10742
props.put("prepareThreshold", "0");
}
Expand Down Expand Up @@ -918,8 +916,7 @@ public DBCQueryTransformer createQueryTransformer(@NotNull DBCQueryTransformType
}

public boolean supportReadingAllDataTypes() {
return CommonUtils.toBoolean(
getContainer().getActualConnectionConfiguration().getProviderProperty(PostgreConstants.PROP_READ_ALL_DATA_TYPES));
return CommonUtils.toBoolean(getContainer().getActualConnectionConfiguration().getProviderProperty(PostgreConstants.PROP_READ_ALL_DATA_TYPES));
}

public boolean supportsReadingKeysWithColumns() {
Expand All @@ -930,8 +927,4 @@ public boolean supportsReadingKeysWithColumns() {
public boolean isSupportsEnumTable() {
return supportsEnumTable;
}

private DBPPreferenceStore getGlobalPreferences() {
return DBWorkbench.getPlatform().getPreferenceStore();
}
}

0 comments on commit be630c6

Please sign in to comment.