DatabaseConnectionPoolConfig

public struct DatabaseConnectionPoolConfig : ServiceType

Used to configure DatabaseConnectionPools created by your application.

  • Creates a new DatabaseConnectionPoolConfig with default settings.

    Declaration

    Swift

    public static func `default`() -> DatabaseConnectionPoolConfig
  • See ServiceType.

    Declaration

    Swift

    public static func makeService(for worker: Container) throws -> DatabaseConnectionPoolConfig
  • Maximum number of connections per pool.

    There will normally be multiple connection pools in your application, usually one per worker (where num workers = num logical CPU cores).

    The minimum supported value is 1, meaning that your database must be able to handle at least n connections where n = num logical CPU cores.

    Declaration

    Swift

    public var maxConnections: Int
  • Creates a new DatabaseConnectionPoolConfig.

    Declaration

    Swift

    public init(maxConnections: Int)

    Parameters

    maxConnections

    Maximum number of connections per pool. See maxConnections property docs for more information.