Skip to content

Initializer

init(establishedChannel:tls:username:password:database:)

Create a configuration for establishing a connection to a Postgres server over a preestablished NIOCore/Channel.
init(establishedChannel channel: any Channel, tls: PostgresConnection.Configuration.TLS, username: String, password: String?, database: String?)

Parameters

channel

The NIOCore/Channel to use. The channel must already be active and connected to an endpoint (i.e. NIOCore/Channel/isActive must be true).

tls

The TLS mode to use.

username

The username to authenticate with.

password

The password to authenticate with.

database

The database to open. If nil, the client connects to the server’s default database.

Discussion

This is provided for calling code which wants to manage the underlying connection transport on its own, such as when tunneling a connection through SSH.