play.api.db

slick

package slick

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. slick
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait CurrentDBAction extends PredicatedDBAction

    Defines the DBAction default behaviour

  2. class DBAction extends PredicatedDBAction

    DB Action, decoupled from Application

    DB Action, decoupled from Application

    Useful for tests, see TestableDBActionTest.scala

  3. case class DBAttributes(executionContext: ExecutionContext, maybeThreadPool: Option[ThreadPoolExecutor], minConnections: Int, maxConnections: Int, partions: Int, maxQueriesPerRequest: Int) extends Product with Serializable

  4. case class DBSessionRequest[A](dbSession: Session, dbExecutionContext: ExecutionContext, request: Request[A]) extends WrappedRequest[A] with Product with Serializable

    Wrapped request with added db-specific information.

    Wrapped request with added db-specific information.

    See the slick package object for implicit functions to extract this information.

  5. class Database extends PlayDatabase

  6. class DefaultSlickConfig extends SlickConfig

    Annotations
    @Singleton()
  7. final class MaybeApplication extends AnyVal

    Value class wrapper for optionally supplied implicit Applications.

  8. trait PredicatedDBAction extends AnyRef

  9. trait Profile extends AnyRef

    This profile makes it easier to use the cake pattern with Slick

    This profile makes it easier to use the cake pattern with Slick

    Example

    class DAO(override val profile: ExtendedProfile) extends CatComponent with Profile
    
    trait CatComponent { this: Profile => //<- step 1: you must add this "self-type"
      import profile.simple._ //<- step 2: then import the correct Table, ... from the profile
    
      object Cats extends Table[Cat]("CAT") {
        ...
      }
    }
    
    object current {
      val dao = new DAO(DB.driver(play.api.Play.current))
    }

    See the sample application for another example

  10. type Session = SessionDef

  11. trait SlickComponents extends AnyRef

  12. trait SlickConfig extends AnyRef

  13. class SlickDynamicEvolutions extends DynamicEvolutions

    Annotations
    @Singleton()
  14. class SlickModule extends Module

    Annotations
    @Singleton()

Value Members

  1. object Config

  2. def DB(name: String)(implicit app: Application): Database

  3. def DB(implicit app: Application): Database

  4. object DBAction extends CurrentDBAction

    Use the DBAction when you want to use the default settings in your controller.

    Use the DBAction when you want to use the default settings in your controller.

    def index = DBAction{ implicit rs =>
      Ok(MyStuff.list())
    }

    By default it uses the database named by default in the configuration in all modes (Prod, Dev) except in test, where it uses test.

    It is possible to define a maximum amount queries per request that can be handled at a given point to avoid overloading the application (user gets the error page instead of seeing a slow app).

    The maximum amount of per requests is read from: db.<db-name>.maxQueriesPerRequest

    If you need to override the default behavior, create a new object with the DefaultDBAction trait.

    class AnotherDBAction(myApp: Application, myErrorPage: Result) extends DefaultDBAction {
      override lazy val app = myApp
      override val errorPage = myErrorPage
    }
  5. object Database

  6. object MaybeApplication

    Use the MaybeApplication wrapper to avoid multiple overloaded methods with defaults.

  7. object SlickExecutionContext

  8. implicit def dbSessionRequestAsExecutionContext[_](implicit r: DBSessionRequest[_]): ExecutionContext

  9. implicit def dbSessionRequestAsSession[_](implicit r: DBSessionRequest[_]): Session

  10. package ddl

  11. package iteratees

Inherited from AnyRef

Inherited from Any

Ungrouped