ConnectionConfiguration

public struct ConnectionConfiguration

The configuration for a Connection to the Postgres server.

  • Creates a ConnectionConfiguration.

    Declaration

    Swift

    public init()
  • The hostname or IP address of the Postgres server. Defaults to localhost.

    Declaration

    Swift

    public var host: String
  • The port number of the Postgres server. Defaults to 5432.

    Declaration

    Swift

    public var port: Int
  • ssl

    Whether to use SSL/TLS to connect to the Postgres server. Defaults to true.

    Declaration

    Swift

    public var ssl: Bool
  • The SSL/TLS configuration for connecting to the Postgres server. Ignored if ssl is false.

    Defaults to SSLService.Configuration(), which:

    • Encrypts the connection
    • Allows a self-signed server certificate
    • Does not authenticate the server certificate
    • Does not present a client certificate

    Refer to the BlueSSLService documentation for additional information on how to initialize and configure the configuration.

    Declaration

    Swift

    public var sslServiceConfiguration: SSLService.Configuration
  • The timeout for socket operations, in seconds, or 0 for no timeout. Defaults to 0.

    Declaration

    Swift

    public var socketTimeout: Int
  • The name of the database on the Postgres server. Defaults to postgres.

    Declaration

    Swift

    public var database: String
  • The Postgres username. Defaults to an empty string.

    Declaration

    Swift

    public var user: String
  • The credential to use to authenticate to the Postgres server. Defaults to Credential.trust.

    Declaration

    Swift

    public var credential: Credential
  • The Postgres application_name parameter. Included in the pg_stat_activity view and displayed by pgAdmin. Defaults to PostgresClientKit.

    Declaration

    Swift

    public var applicationName: String