Skip to content

Commit

Permalink
Add missing deprecated method (#210)
Browse files Browse the repository at this point in the history
Add missing deprecated method whose lack causes completely unhelpful compiler errors for those affected.
  • Loading branch information
gwynne authored May 10, 2023
1 parent 8817a61 commit 0aa809c
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ extension DatabaseConfigurationFactory {
)
}

@available(*, deprecated, message: "Use `.postgres(configuration:.init(hostname:port:username:password:database:tls:),maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)` instead.")
public static func postgres(
hostname: String, port: Int = PostgresConfiguration.ianaPortNumber,
username: String, password: String, database: String? = nil, tlsConfiguration: TLSConfiguration? = nil,
maxConnectionsPerEventLoop: Int = 1, connectionPoolTimeout: TimeAmount = .seconds(10),
sqlLogLevel: Logger.Level = .debug
) -> DatabaseConfigurationFactory {
.postgres(
hostname: hostname, port: port, username: username, password: password, database: database, tlsConfiguration: tlsConfiguration,
maxConnectionsPerEventLoop: maxConnectionsPerEventLoop, connectionPoolTimeout: connectionPoolTimeout,
encoder: .init(), decoder: .init(), sqlLogLevel: sqlLogLevel
)
}

@available(*, deprecated, message: "Use `.postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)` instead.")
public static func postgres(
hostname: String, port: Int = PostgresConfiguration.ianaPortNumber,
Expand Down

0 comments on commit 0aa809c

Please sign in to comment.