slick.backend.DatabaseComponent
Free all resources allocated by Slick for this Database.
Create the default DatabaseActionContext for this backend.
Create the default DatabaseActionContext for this backend.
Create a new session.
Create a new session. The session needs to be closed explicitly by calling its close() method.
Create the default StreamingDatabaseActionContext for this backend.
Create the default StreamingDatabaseActionContext for this backend.
Return the default ExecutionContet for this Database which should be used for running SynchronousDatabaseActions for asynchronous execution.
Return the default ExecutionContet for this Database which should be used for running SynchronousDatabaseActions for asynchronous execution.
Within a synchronous execution, ensure that a Session is available.
Within a synchronous execution, ensure that a Session is available.
Create a Reactive Streams Publisher
using the given context factory.
Create a Reactive Streams Publisher
using the given context factory.
Within a synchronous execution, close the current Session unless it is pinned.
Within a synchronous execution, close the current Session unless it is pinned.
If set to true, swallow all non-fatal errors that arise while closing the Session.
Run an Action asynchronously and return the result as a Future.
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.
Whether to return the result as a stream. In this case, the context must
be a StreamingDatabaseActionContext
and the Future result should be
completed with null
or failed after streaming has finished. This
method should not call any Subscriber
method other than onNext
.
Run a SynchronousDatabaseAction
on this database.
Run a SynchronousDatabaseAction
on this database.
Stream a part of the results of a SynchronousDatabaseAction
on this database.
Stream a part of the results of a SynchronousDatabaseAction
on this database.
Create a Publisher
for Reactive Streams which, when subscribed to, will run the specified
Action 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
Action 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 will only serve a single Subscriber and cannot be
reused (because multiple runs of an Action can produce different results, which is not
allowed for a Publisher).
For the purpose of combinators such as andFinally
which can run after a stream has been
produced, consuming the stream is always considered to be successful, even when cancelled
by the Subscriber. 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).
Stream a SynchronousDatabaseAction
on this database.
Stream a SynchronousDatabaseAction
on this database.
Run the supplied function with a new session and automatically close the session at the end.
Run the supplied function with a new session and automatically close the session at the end. Exceptions thrown while closing the session are propagated, but only if the code block using the session terminated normally. Otherwise the first exception wins.
(databaseDef: StringAdd).self
(databaseDef: StringFormat).self
Run the supplied thunk with a new session and automatically close the session at the end.
Run the supplied thunk with a new session and automatically close the session at the end. The session is stored in a dynamic (inheritable thread-local) variable which can be accessed with the implicit function in Database.dynamicSession.
(Since version 3.0) Use the new Action-based API instead
Run the supplied thunk with a new session in a transaction and automatically close the session at the end.
Run the supplied thunk with a new session in a transaction and automatically close the session at the end. The session is stored in a dynamic (inheritable thread-local) variable which can be accessed with the implicit function in Database.dynamicSession.
(Since version 3.0) Use the new Action-based API instead
Run the supplied function with a new session in a transaction and automatically close the session at the end.
Run the supplied function with a new session in a transaction and automatically close the session at the end.
(Since version 3.0) Use the new Action-based API instead
(databaseDef: ArrowAssoc[DatabaseDef]).x
(Since version 2.10.0) Use leftOfArrow
instead
(databaseDef: Ensuring[DatabaseDef]).x
(Since version 2.10.0) Use resultOfEnsuring
instead
A database instance to which connections can be created.