Type Method
postgres(url:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)
Create a PostgreSQL database configuration from a URL string.
static func postgres(url urlString: String, maxConnectionsPerEventLoop: Int = 1, connectionPoolTimeout: TimeAmount = .seconds(10), encodingContext: PostgresEncodingContext<some PostgresJSONEncoder> = .default, decodingContext: PostgresDecodingContext<some PostgresJSONDecoder> = .default, sqlLogLevel: Logger.Level = .debug) throws -> DatabaseConfigurationFactory
Parameters
urlStringThe URL describing the connection, as a string.
maxConnectionsPerEventLoopMaximum number of connections to open per event loop.
connectionPoolTimeoutMaximum time to wait for a connection to become available per request.
encodingContextEncoding context to use for serializing data.
decodingContextDecoding context to use for deserializing data.
sqlLogLevelLevel at which to log SQL queries.
Discussion
See PostgresKit/SQLPostgresConfiguration/init(url:) for the allowed URL format.