scala.slick

action

package action

Content Hierarchy Learn more about scaladoc diagrams
Visibility
  1. Public
  2. All

Type Members

  1. sealed trait Action[-E <: Effect, +R, +S <: NoStream] extends Dumpable

    An Action that can be executed on a database.

    An Action that can be executed on a database. The Action type allows a separation of execution logic and resource usage management logic from composition logic. Actions can be composed with methods such as andThen, andFinally and flatMap. Individual parts of a composite Action are always executed serially on a single database, but possibly in different database sessions, unless the session is pinned either explicitly (using withPinnedSession) or implicitly (e.g. through a transaction).

    E

    The Action's effect type, e.g. Effect.Read with Effect.Write. When composing Actions, the correct combined effect type will be inferred. Effects are used to tie an Action to a specific back-end type and they can also be used in user code, e.g. to automatically direct all read-only Actions to a slave database and write Actions to the master copy.

    R

    The result type when executing the Action and fully materializing the result.

    S

    An encoding of the result type for streaming results. If this action is capable of streaming, it is Streaming[T] for an element type T. For non-streaming Actions it is NoStream.

  2. trait ActionContext[+B <: DatabaseComponent] extends AnyRef

    The context object passed to database actions by the execution engine.

  3. case class AndThenAction[-E <: Effect, +R, +S <: NoStream](a1: Action[E, _, NoStream], a2: Action[E, R, S]) extends Action[E, R, S] with Product with Serializable

    An Action that represents an andThen operation for sequencing in the Action monad.

  4. case class AsTryAction[-E <: Effect, +R](a: Action[E, R, NoStream]) extends Action[E, Try[R], NoStream] with Product with Serializable

    An Action that represents an asTry operation.

  5. case class CleanUpAction[-E <: Effect, +R, +S <: NoStream](base: Action[E, R, S], f: (Option[Throwable]) ⇒ Action[E, _, NoStream], keepFailure: Boolean, executor: ExecutionContext) extends Action[E, R, S] with Product with Serializable

    An Action that represents a cleanUp operation for sequencing in the Action monad.

  6. trait DatabaseAction[-E <: Effect, +R, +S <: NoStream] extends Action[E, R, S]

    An Action that represents a database operation.

    An Action that represents a database operation. Concrete implementations are backend-specific.

  7. trait Effect extends AnyRef

    A phantom type for annotating database Actions with specific effects (e.g.

    A phantom type for annotating database Actions with specific effects (e.g. Write or Transactional). Effects can be composed through intersection types (e.g. Write with Transactional. Backends declare all supported types to prevent execution of unsupported features (e.g. scala.slick.memory.HeapBackend does not support transactions). Further restrictions (like ensuring that all writes go to a master database but reads can also be performed by a slave) can be enforced in user-level code.

  8. case class FailedAction[-E <: Effect](a: Action[E, _, NoStream]) extends Action[E, Throwable, NoStream] with Product with Serializable

    An Action that represents a failed operation.

  9. case class FailureAction(t: Throwable) extends SynchronousDatabaseAction[Nothing, Effect, Nothing, NoStream] with Product with Serializable

    An Action that fails.

  10. case class FlatMapAction[-E <: Effect, +R, +S <: NoStream, P](base: Action[E, P, NoStream], f: (P) ⇒ Action[E, R, S], executor: ExecutionContext) extends Action[E, R, S] with Product with Serializable

    An Action that represents a flatMap operation for sequencing in the Action monad.

  11. case class FutureAction[+R](f: Future[R]) extends Action[Effect, R, NoStream] with Product with Serializable

    An asynchronous Action that returns the result of a Future.

  12. case class NamedAction[-E <: Effect, +R, +S <: NoStream](a: Action[E, R, S], name: String) extends Action[E, R, S] with Product with Serializable

    An Action that attaches a name for logging purposes to another action.

  13. sealed trait NoStream extends AnyRef

    A phantom type used as the streaming result type for Actions that do not support streaming.

    A phantom type used as the streaming result type for Actions that do not support streaming. Note that this is a supertype of Streaming (and it is used in covariant position), so that any streaming Action can be used where a non-streaming Action is expected.

  14. sealed trait Streaming[+T] extends NoStream

    A phantom type used as the streaming result type for Actions that do support streaming.

  15. trait StreamingActionContext[+B <: DatabaseComponent] extends ActionContext[B]

    An ActionContext with extra functionality required for streaming Actions.

  16. case class SuccessAction[+R](value: R) extends SynchronousDatabaseAction[Nothing, Effect, R, NoStream] with Product with Serializable

    An Action that returns a constant value.

  17. trait SynchronousDatabaseAction[B <: DatabaseComponent, -E <: Effect, +R, +S <: NoStream] extends DatabaseAction[E, R, S]

    A synchronous database action provides a function from an ActionContext to the result type.

    A synchronous database action provides a function from an ActionContext to the result type. DatabaseComponent.DatabaseDef.run supports this kind of action out of the box through DatabaseComponent.DatabaseDef.runSynchronousDatabaseAction so that run does not need to be extended if all primitive database actions can be expressed in this way. These actions also implement construction-time fusion for the andFinally, andThen, asTry, failed, withPinnedSession and zip operations.

    The execution engine ensures that an ActionContext is never used concurrently and that all state changes performed by one invocation of a SynchronousDatabaseAction are visible to the next invocation of the same or a different SynchronousDatabaseAction.

  18. case class ZipAction[-E <: Effect, +R1, +R2](a1: Action[E, R1, NoStream], a2: Action[E, R2, NoStream]) extends Action[E, (R1, R2), NoStream] with Product with Serializable

    An Action that represents a zip operation for sequencing in the Action monad.

Value Members

  1. object Action

  2. object Effect

  3. object SynchronousDatabaseAction

  4. object Unsafe

    Some utility methods for working with database results in a synchronous or blocking way that can be detrimental to performance when used incorrectly.

Ungrouped