open static method

Future<PostgresExecutor> open({
  1. String host = "localhost",
  2. int port = 5432,
  3. required String username,
  4. required String password,
  5. required String database,
  6. bool ssl = false,
})

Implementation

static Future<PostgresExecutor> open(
    {String host = "localhost", int port = 5432, required String username, required String password, required String database, bool ssl = false}) async {
  final c = await pg.Connection.open(pg.Endpoint(host: host, port: port, database: database, username: username, password: password),
      settings: pg.ConnectionSettings(sslMode: ssl ? pg.SslMode.require : pg.SslMode.disable));
  return PostgresExecutor(c);
}