Skip to content

Commit 0aa809c

Browse files
authored
Add missing deprecated method (#210)
Add missing deprecated method whose lack causes completely unhelpful compiler errors for those affected.
1 parent 8817a61 commit 0aa809c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Sources/FluentPostgresDriver/Deprecations/FluentPostgresConfiguration+Deprecated.swift

+14
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,20 @@ extension DatabaseConfigurationFactory {
116116
)
117117
}
118118

119+
@available(*, deprecated, message: "Use `.postgres(configuration:.init(hostname:port:username:password:database:tls:),maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)` instead.")
120+
public static func postgres(
121+
hostname: String, port: Int = PostgresConfiguration.ianaPortNumber,
122+
username: String, password: String, database: String? = nil, tlsConfiguration: TLSConfiguration? = nil,
123+
maxConnectionsPerEventLoop: Int = 1, connectionPoolTimeout: TimeAmount = .seconds(10),
124+
sqlLogLevel: Logger.Level = .debug
125+
) -> DatabaseConfigurationFactory {
126+
.postgres(
127+
hostname: hostname, port: port, username: username, password: password, database: database, tlsConfiguration: tlsConfiguration,
128+
maxConnectionsPerEventLoop: maxConnectionsPerEventLoop, connectionPoolTimeout: connectionPoolTimeout,
129+
encoder: .init(), decoder: .init(), sqlLogLevel: sqlLogLevel
130+
)
131+
}
132+
119133
@available(*, deprecated, message: "Use `.postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)` instead.")
120134
public static func postgres(
121135
hostname: String, port: Int = PostgresConfiguration.ianaPortNumber,

0 commit comments

Comments
 (0)