DatabaseConnection

public protocol DatabaseConnection : DatabaseConnectable, Extendable

Types conforming to this protocol can be used as a Database.Connection.

Most of the database interaction work is done through static methods on Database that accept a connection. However, there are a few things like isClosed and close() that a connection must implement.

  • This connection’s associated database type.

    Declaration

    Swift

    associatedtype Database : Database where Self == Self.Database.Connection
  • If true, this connection has been closed and is no longer valid. This is used by DatabaseConnectionPool to prune inactive connections.

    Declaration

    Swift

    var isClosed: Bool { get }
  • Closes the DatabaseConnection.

    Declaration

    Swift

    func close()