t

io.rdbc.sapi

ConnectionFactory

trait ConnectionFactory extends AnyRef

Provides access to a database Connection.

Implementors must make the implementation of this trait thread-safe.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConnectionFactory
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def connection(): Future[Connection]

    Returns a future of a Connection.

  2. abstract def shutdown(): Future[Unit]

    Shuts down this connection factory.

    Shuts down this connection factory.

    Returned future never fails - it completes on finished shutdown attempt. After the factory is shut down it is illegal to request new connections from it.

  3. abstract def withConnection[A](body: (Connection) ⇒ A): Future[A]

    Executes a function in a context of a connection.

    Executes a function in a context of a connection.

    Executes a function (which can be passed as a code block) in a context of a connection obtained via connection method, and releases the connection afterwards.

  4. abstract def withConnectionF[A](body: (Connection) ⇒ Future[A]): Future[A]

    Executes a future-returning function in a context of a connection.

    Executes a future-returning function in a context of a connection.

    Executes a function (which can be passed as a code block) in a context of a connection obtained via connection method, and releases the connection afterwards.

  5. abstract def withTransaction[A](body: (Connection) ⇒ A)(implicit timeout: Timeout): Future[A]

    Executes a function in a context of a transaction.

    Executes a function in a context of a transaction.

    Executes a function (which can be passed as a code block) in a context of a connection obtained via connection method. Before the function is executed, transaction is started. After the function finishes, transaction is committed in case of a success and rolled back in case of a failure - after that, the connection is released.

    Because managing transaction state requires invoking functions that require specifying a timeout, this function requires an implicit timeout instance.

  6. abstract def withTransactionF[A](body: (Connection) ⇒ Future[A])(implicit timeout: Timeout): Future[A]

    Executes a future-returning function in a context of a transaction.

    Executes a future-returning function in a context of a transaction.

    Executes a function (which can be passed as a code block) in a context of a connection obtained via connection method. Before the function is executed, transaction is started. After the function finishes, transaction is committed in case of a success and rolled back in case of a failure - after that, the connection is released.

    Because managing transaction state requires invoking functions that require specifying a timeout, this function requires an implicit timeout instance.