Skip to content

Type Method

connect(on:configuration:id:logger:)

Creates a new connection to a Postgres server.
static func connect(on eventLoop: any EventLoop = PostgresConnection.defaultEventLoopGroup.any(), configuration: PostgresConnection.Configuration, id connectionID: PostgresConnection.ID, logger: Logger) async throws -> PostgresConnection

Parameters

eventLoop

The EventLoop the connection shall be created on.

configuration

A PostgresConnection.Configuration that shall be used for the connection.

connectionID

An Int id, used for metadata logging

logger

A logger to log background events into.

Return Value

An established PostgresConnection that can be used to run queries.