Skip to content

Type Method

postgres(configuration:maxConnectionsPerEventLoop:connectionPoolTimeout:encodingContext:decodingContext:sqlLogLevel:)

Create a PostgreSQL database configuration from lower-level configuration.
static func postgres(configuration: SQLPostgresConfiguration, maxConnectionsPerEventLoop: Int = 1, connectionPoolTimeout: TimeAmount = .seconds(10), encodingContext: PostgresEncodingContext<some PostgresJSONEncoder>, decodingContext: PostgresDecodingContext<some PostgresJSONDecoder>, sqlLogLevel: Logger.Level = .debug) -> DatabaseConfigurationFactory

Parameters

configuration

A PostgresKit/SQLPostgresConfiguration describing the connection.

maxConnectionsPerEventLoop

Maximum number of connections to open per event loop.

connectionPoolTimeout

Maximum time to wait for a connection to become available per request.

encodingContext

Encoding context to use for serializing data.

decodingContext

Decoding context to use for deserializing data.

sqlLogLevel

Level at which to log SQL queries.