@@ -192,9 +192,22 @@ extension PostgresConnection {
192
192
/// - Parameters:
193
193
/// - channel: The `NIOCore/Channel` to use. The channel must already be active and connected to an
194
194
/// endpoint (i.e. `NIOCore/Channel/isActive` must be `true`).
195
- /// - tls: The TLS mode to use. Defaults to ``TLS-swift.struct/disable``.
195
+ /// - tls: The TLS mode to use.
196
+ public init ( establishedChannel channel: Channel , tls: PostgresConnection . Configuration . TLS , username: String , password: String ? , database: String ? ) {
197
+ self . init ( endpointInfo: . configureChannel( channel) , tls: tls, username: username, password: password, database: database)
198
+ }
199
+
200
+ /// Create a configuration for establishing a connection to a Postgres server over a preestablished
201
+ /// `NIOCore/Channel`.
202
+ ///
203
+ /// This is provided for calling code which wants to manage the underlying connection transport on its
204
+ /// own, such as when tunneling a connection through SSH.
205
+ ///
206
+ /// - Parameters:
207
+ /// - channel: The `NIOCore/Channel` to use. The channel must already be active and connected to an
208
+ /// endpoint (i.e. `NIOCore/Channel/isActive` must be `true`).
196
209
public init ( establishedChannel channel: Channel , username: String , password: String ? , database: String ? ) {
197
- self . init ( endpointInfo : . configureChannel ( channel) , tls: . disable, username: username, password: password, database: database)
210
+ self . init ( establishedChannel : channel, tls: . disable, username: username, password: password, database: database)
198
211
}
199
212
200
213
// MARK: - Implementation details
0 commit comments