From 0aa809c4e097e6a7dd8b24a19ef8c2e17b4992d2 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Wed, 10 May 2023 08:10:57 -0500 Subject: [PATCH] Add missing deprecated method (#210) Add missing deprecated method whose lack causes completely unhelpful compiler errors for those affected. --- .../FluentPostgresConfiguration+Deprecated.swift | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Sources/FluentPostgresDriver/Deprecations/FluentPostgresConfiguration+Deprecated.swift b/Sources/FluentPostgresDriver/Deprecations/FluentPostgresConfiguration+Deprecated.swift index f9d2e74..6cfbfa6 100644 --- a/Sources/FluentPostgresDriver/Deprecations/FluentPostgresConfiguration+Deprecated.swift +++ b/Sources/FluentPostgresDriver/Deprecations/FluentPostgresConfiguration+Deprecated.swift @@ -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,