Packages

c

slick.jdbc.JdbcBackend

JdbcDatabaseDef

class JdbcDatabaseDef extends BasicDatabaseDef

Source
JdbcBackend.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JdbcDatabaseDef
  2. BasicDatabaseDef
  3. Closeable
  4. AutoCloseable
  5. AnyRef
  6. Any
Implicitly
  1. by StringFormat
  2. by Ensuring
  3. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new JdbcDatabaseDef(source: JdbcDataSource, executor: AsyncExecutor)

Value Members

  1. def close(): Unit

    Free all resources allocated by Slick for this Database object.

    Free all resources allocated by Slick for this Database object. In particular, the slick.util.AsyncExecutor with the thread pool for asynchronous execution is shut down. If this object represents a connection pool managed directly by Slick, it is also closed.

    Definition Classes
    JdbcDatabaseDefBasicDatabaseDef → Closeable → AutoCloseable
  2. def createSession(): Session

    Create a new session.

    Create a new session. The session needs to be closed explicitly by calling its close() method.

    Definition Classes
    JdbcDatabaseDefBasicDatabaseDef
  3. val executor: AsyncExecutor
  4. final def io[T](thunk: => T): Future[T]

    Run some code on the ioExecutionContext.

  5. final def ioExecutionContext: ExecutionContext

    The ExecutionContext which is used for performing blocking database I/O, similar to how run or stream would run it.

    The ExecutionContext which is used for performing blocking database I/O, similar to how run or stream would run it. This can be used for calling back into blocking JDBC APIs (e.g. for materializing a LOB or mutating a result set row) from asynchronous processors of unbuffered streams.

  6. final def run[R](a: DBIOAction[R, NoStream, Nothing]): Future[R]

    Run an Action asynchronously and return the result as a Future.

    Run an Action asynchronously and return the result as a Future.

    Definition Classes
    BasicDatabaseDef
  7. def shutdown: Future[Unit]

    Free all resources allocated by Slick for this Database.

    Free all resources allocated by Slick for this Database. This is done asynchronously, so you need to wait for the returned Future to complete in order to ensure that everything has been shut down.

    Definition Classes
    BasicDatabaseDef
  8. val source: JdbcDataSource
  9. final def stream[T](a: StreamingDBIO[_, T], bufferNext: Boolean): DatabasePublisher[T]

    Like stream(StreamingAction) but you can disable pre-buffering of the next row by setting bufferNext = false.

    Like stream(StreamingAction) but you can disable pre-buffering of the next row by setting bufferNext = false. The ResultSet will not advance to the next row until you request() more data. This allows you to process LOBs asynchronously by requesting only one single element at a time after processing the current one, so that the proper sequencing is preserved even though processing may happen on a different thread.

  10. final def stream[T](a: DBIOAction[_, Streaming[T], Nothing]): DatabasePublisher[T]

    Create a Publisher for Reactive Streams which, when subscribed to, will run the specified DBIOAction and return the result directly as a stream without buffering everything first.

    Create a Publisher for Reactive Streams which, when subscribed to, will run the specified DBIOAction and return the result directly as a stream without buffering everything first. This method is only supported for streaming actions.

    The Publisher itself is just a stub that holds a reference to the action and this Database. The action does not actually start to run until the call to onSubscribe returns, after which the Subscriber is responsible for reading the full response or cancelling the Subscription. The created Publisher can be reused to serve a multiple Subscribers, each time triggering a new execution of the action.

    For the purpose of combinators such as cleanup which can run after a stream has been produced, cancellation of a stream by the Subscriber is not considered an error. For example, there is no way for the Subscriber to cause a rollback when streaming the results of someQuery.result.transactionally.

    When using a JDBC back-end, all onNext calls are done synchronously and the ResultSet row is not advanced before onNext returns. This allows the Subscriber to access LOB pointers from within onNext. If streaming is interrupted due to back-pressure signaling, the next row will be prefetched (in order to buffer the next result page from the server when a page boundary has been reached).

    Definition Classes
    BasicDatabaseDef