open method
Implementation
@override
Future<void> open() async {
connection = PostgreSQLConnection(
connectionInfo.host,
connectionInfo.port,
connectionInfo.database,
username: connectionInfo.username,
password: connectionInfo.password,
useSSL: connectionInfo.useSSL,
timeoutInSeconds: connectionInfo.timeoutInSeconds,
);
//print( 'PostgreSqlExecutor@open timeoutInSeconds: ${connectionInfo!.timeoutInSeconds}');
var com = connection as PostgreSQLConnection;
await com.open();
//isso executa uma query para definir os esquemas
if (connectionInfo.enablePsqlAutoSetSearchPath == true &&
connectionInfo.schemes?.isNotEmpty == true) {
await query('set search_path to $schemesString;');
}
/* } else if (connection is PostgreSQLConnection) {
var com = connection as PostgreSQLConnection;
if (com.isClosed) {
connection = PostgreSQLConnection(
connectionInfo!.host,
connectionInfo!.port!,
connectionInfo!.database,
username: connectionInfo!.username,
password: connectionInfo!.password,
);
com = connection as PostgreSQLConnection;
await com.open();
//isso executa uma query para definir os esquemas
if (connectionInfo?.enablePsqlAutoSetSearchPath == true &&
connectionInfo?.schemes?.isNotEmpty == true) {
await query('set search_path to $schemesString;', {});
}
}
} else {
await Future.value();
}*/
//print('PostgreSqlExecutor@open connection ${connection}');
}