class JdbcDatabaseDef extends BasicDatabaseDef
- Alphabetic
- By Inheritance
- JdbcDatabaseDef
- BasicDatabaseDef
- Closeable
- AutoCloseable
- AnyRef
- Any
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new JdbcDatabaseDef(source: JdbcDataSource, executor: AsyncExecutor)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def ->[B](y: B): (JdbcDatabaseDef, B)
- Implicit
- This member is added by an implicit conversion from JdbcDatabaseDef toArrowAssoc[JdbcDatabaseDef] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def acquireSession(ctx: Context): Unit
Within a synchronous execution, ensure that a Session is available.
Within a synchronous execution, ensure that a Session is available.
- Attributes
- protected[this]
- Definition Classes
- BasicDatabaseDef
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- var capabilities: DatabaseCapabilities
The DatabaseCapabilities, accessed through a Session and created by the first Session that needs them.
The DatabaseCapabilities, accessed through a Session and created by the first Session that needs them. Access does not need to be synchronized because, in the worst case, capabilities will be determined multiple times by different concurrent sessions but the result should always be the same.
- Attributes
- protected[JdbcBackend]
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- 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
- JdbcDatabaseDef → BasicDatabaseDef → Closeable → AutoCloseable
- def createDatabaseActionContext[T](_useSameThread: Boolean): Context
Create the default DatabaseActionContext for this backend.
Create the default DatabaseActionContext for this backend.
- Attributes
- protected[this]
- Definition Classes
- JdbcDatabaseDef → BasicDatabaseDef
- def createPublisher[T](a: DBIOAction[_, Streaming[T], Nothing], createCtx: (Subscriber[_ >: T]) => StreamingContext): DatabasePublisher[T]
Create a Reactive Streams
Publisher
using the given context factory.Create a Reactive Streams
Publisher
using the given context factory.- Attributes
- protected[this]
- Definition Classes
- BasicDatabaseDef
- 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
- JdbcDatabaseDef → BasicDatabaseDef
- def createStreamingDatabaseActionContext[T](s: Subscriber[_ >: T], useSameThread: Boolean): StreamingContext
Create the default StreamingDatabaseActionContext for this backend.
Create the default StreamingDatabaseActionContext for this backend.
- Attributes
- protected[this]
- Definition Classes
- JdbcDatabaseDef → BasicDatabaseDef
- def ensuring(cond: (JdbcDatabaseDef) => Boolean, msg: => Any): JdbcDatabaseDef
- Implicit
- This member is added by an implicit conversion from JdbcDatabaseDef toEnsuring[JdbcDatabaseDef] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (JdbcDatabaseDef) => Boolean): JdbcDatabaseDef
- Implicit
- This member is added by an implicit conversion from JdbcDatabaseDef toEnsuring[JdbcDatabaseDef] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): JdbcDatabaseDef
- Implicit
- This member is added by an implicit conversion from JdbcDatabaseDef toEnsuring[JdbcDatabaseDef] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): JdbcDatabaseDef
- Implicit
- This member is added by an implicit conversion from JdbcDatabaseDef toEnsuring[JdbcDatabaseDef] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- val executor: AsyncExecutor
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def io[T](thunk: => T): Future[T]
Run some code on the ioExecutionContext.
- final def ioExecutionContext: ExecutionContext
The
ExecutionContext
which is used for performing blocking database I/O, similar to howrun
orstream
would run it.The
ExecutionContext
which is used for performing blocking database I/O, similar to howrun
orstream
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. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def logAction(a: DBIOAction[_, NoStream, Nothing], ctx: Context): Unit
- Attributes
- protected[this]
- Definition Classes
- BasicDatabaseDef
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def prioritizedRunnable(priority: => Priority, run: (SetConnectionReleased) => Unit): PrioritizedRunnable
- Attributes
- protected
- Definition Classes
- JdbcDatabaseDef → BasicDatabaseDef
- final def releaseSession(ctx: Context, handleCloseError: PartialFunction[Throwable, Unit] = PartialFunction.empty): Unit
Within a synchronous execution, close the current Session unless it is pinned.
Within a synchronous execution, close the current Session unless it is pinned.
- handleCloseError
What to do with non-fatal errors that arise while closing the Session.
- Attributes
- protected[this]
- Definition Classes
- BasicDatabaseDef
- 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
- def runInContext[R](a: DBIOAction[R, NoStream, Nothing], ctx: Context, streaming: Boolean, topLevel: Boolean): Future[R]
Run an Action in an existing DatabaseActionContext.
Run an Action in an existing DatabaseActionContext. This method can be overridden in subclasses to support new DatabaseActions which cannot be expressed through SynchronousDatabaseAction.
- streaming
Whether to return the result as a stream. In this case, the context must be a
StreamingDatabaseActionContext
and the Future result should be completed withnull
or failed after streaming has finished. This method should not call anySubscriber
method other thanonNext
.
- Attributes
- protected[this]
- Definition Classes
- BasicDatabaseDef
- def runSynchronousDatabaseAction[R](a: SynchronousDatabaseAction[R, NoStream, This, _], ctx: Context, continuation: Boolean): Future[R]
Run a
SynchronousDatabaseAction
on this database.Run a
SynchronousDatabaseAction
on this database.- Attributes
- protected[this]
- Definition Classes
- BasicDatabaseDef
- def scheduleSynchronousStreaming(a: SynchronousDatabaseAction[_, _ <: NoStream, This, _ <: Effect], ctx: StreamingContext, continuation: Boolean)(initialState: StreamState): Unit
Stream a part of the results of a
SynchronousDatabaseAction
on this database.Stream a part of the results of a
SynchronousDatabaseAction
on this database.- Attributes
- protected[BasicBackend]
- Definition Classes
- BasicDatabaseDef
- 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
- val source: JdbcDataSource
- 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 settingbufferNext = false
.Like
stream(StreamingAction)
but you can disable pre-buffering of the next row by settingbufferNext = false
. The ResultSet will not advance to the next row until yourequest()
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. - final def stream[T](a: DBIOAction[_, Streaming[T], Nothing]): DatabasePublisher[T]
Create a
Publisher
for Reactive Streams which, when subscribed to, will run the specifiedDBIOAction
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 specifiedDBIOAction
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 ofsomeQuery.result.transactionally
.When using a JDBC back-end, all
onNext
calls are done synchronously and the ResultSet row is not advanced beforeonNext
returns. This allows the Subscriber to access LOB pointers from withinonNext
. 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
- def streamSynchronousDatabaseAction(a: SynchronousDatabaseAction[_, _ <: NoStream, This, _ <: Effect], ctx: StreamingContext, continuation: Boolean): Future[Null]
Stream a
SynchronousDatabaseAction
on this database.Stream a
SynchronousDatabaseAction
on this database.- Attributes
- protected[this]
- Definition Classes
- BasicDatabaseDef
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def synchronousExecutionContext: ExecutionContext
Return the default ExecutionContext for this Database which should be used for running SynchronousDatabaseActions for asynchronous execution.
Return the default ExecutionContext for this Database which should be used for running SynchronousDatabaseActions for asynchronous execution.
- Attributes
- protected[this]
- Definition Classes
- JdbcDatabaseDef → BasicDatabaseDef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from JdbcDatabaseDef toStringFormat[JdbcDatabaseDef] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
- def →[B](y: B): (JdbcDatabaseDef, B)
- Implicit
- This member is added by an implicit conversion from JdbcDatabaseDef toArrowAssoc[JdbcDatabaseDef] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
edit this text on github
Scala Language-Integrated Connection Kit
This is the API documentation for the Slick database library. It should be used as an additional resource to the user manual.
Further documentation for Slick can be found on the documentation pages.
To the slick package list...