Extended Structure
DatabaseConfigurationFactory
We’d like to just default the context parameters of the “actual” method. Unfortunately, there are a few cases involving the UNIX domain socket initalizer where usage can resolve to either the new
SQLPostgresConfiguration-based method or the deprecated PostgresConfiguration-based method, with no obvious way to disambiguate which to call. Because the context parameters are generic, if they are defaulted, the compiler resolves the ambiguity in favor of the deprecated method (which has no generic parameters). However, by adding the non-defaulted-parameter variant which takes neither context, we’ve provided a version which has no generic parameters either, which allows the compiler to resolve the ambiguity in favor of the one with better availability (i.e. the one that isn’t deprecated).extension DatabaseConfigurationFactory
Overview
Example affected code:
_ = DatabaseConfigurationFactory.postgres(configuration: .init(unixDomainSocketPath: "", username: ""))
Topics
Type Methods
postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:decodingContext:sqlLogLevel:)postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)with theencodingContextdefaulted.postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encoder:decoder:sqlLogLevel:)postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)Create a PostgreSQL database configuration from lower-level configuration.postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:sqlLogLevel:)postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)with thedecodingContextdefaulted.postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:pruneInterval:maxIdleTimeBeforePruning:decodingContext:sqlLogLevel:)postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:pruneInterval:maxIdleTimeBeforePruning:encodingContext:decodingContext:sqlLogLevel:)Create a PostgreSQL database configuration from lower-level configuration.postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:pruneInterval:maxIdleTimeBeforePruning:encodingContext:sqlLogLevel:)postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:pruneInterval:maxIdleTimeBeforePruning:sqlLogLevel:)postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:pruneInterval:maxIdleTimeBeforePruning:encodingContext:decodingContext:sqlLogLevel:)with bothencodingContextanddecodingContextdefaulted.postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:sqlLogLevel:)postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)with bothencodingContextanddecodingContextdefaulted.postgres(hostname:port:username:password:database:tlsConfiguration:maxConnectionsPerEventLoop:connectionPoolTimeout:encoder:decoder:sqlLogLevel:)postgres(url:maxConnectionsPerEventLoop:connectionPoolTimeout:decoder:sqlLogLevel:)postgres(url:maxConnectionsPerEventLoop:connectionPoolTimeout:encoder:decoder:sqlLogLevel:)postgres(url:maxConnectionsPerEventLoop:connectionPoolTimeout:encoder:sqlLogLevel:)postgres(url:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)Create a PostgreSQL database configuration from a URL string.postgres(url:maxConnectionsPerEventLoop:connectionPoolTimeout:pruneInterval:maxIdleTimeBeforePruning:encodingContext:decodingContext:sqlLogLevel:)Create a PostgreSQL database configuration from a URL string.