R2dbcExecutor

akka.persistence.r2dbc.internal.R2dbcExecutor
See theR2dbcExecutor companion object
@InternalStableApi
class R2dbcExecutor(val connectionFactory: ConnectionFactory, log: Logger, logDbCallsExceeding: FiniteDuration)(implicit ec: ExecutionContext, system: ActorSystem[_])

INTERNAL API:

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def executeDdl(logPrefix: String)(statement: Connection => Statement): Future[Done]

Run DDL statement with auto commit.

Run DDL statement with auto commit.

Attributes

def executeDdls(logPrefix: String)(statementFactory: Connection => IndexedSeq[Statement]): Future[Done]

Run DDL statements in the same transaction.

Run DDL statements in the same transaction.

Attributes

def select[A](logPrefix: String)(statement: Connection => Statement, mapRow: Row => A): Future[IndexedSeq[A]]
def selectOne[A](logPrefix: String)(statement: Connection => Statement, mapRow: Row => A): Future[Option[A]]
def update(logPrefix: String)(statementsFactory: Connection => IndexedSeq[Statement]): Future[IndexedSeq[Long]]

Several update statements in the same transaction.

Several update statements in the same transaction.

Attributes

def updateInBatch(logPrefix: String)(statementFactory: Connection => Statement): Future[Long]

Update statement that is constructed by several statements combined with add().

Update statement that is constructed by several statements combined with add().

Attributes

def updateInBatchReturning[A](logPrefix: String)(statementFactory: Connection => Statement, mapRow: Row => A): Future[IndexedSeq[A]]

Update statement that is constructed by several statements combined with add(). Returns the mapped result of all rows. For example with Postgres:

Update statement that is constructed by several statements combined with add(). Returns the mapped result of all rows. For example with Postgres:

INSERT INTO foo(name) VALUES ('bar') returning db_timestamp

Attributes

def updateOne(logPrefix: String)(statementFactory: Connection => Statement): Future[Long]

One update statement with auto commit.

One update statement with auto commit.

Attributes

def updateOneReturning[A](logPrefix: String)(statementFactory: Connection => Statement, mapRow: Row => A): Future[A]

One update statement with auto commit and return mapped result. For example with Postgres:

One update statement with auto commit and return mapped result. For example with Postgres:

INSERT INTO foo(name) VALUES ('bar') returning db_timestamp

Attributes

def withAutoCommitConnection[A](logPrefix: String)(fun: Connection => Future[A]): Future[A]

Runs the passed function in using a Connection with auto-commit enable (non-transactional).

Runs the passed function in using a Connection with auto-commit enable (non-transactional).

Attributes

def withConnection[A](logPrefix: String)(fun: Connection => Future[A]): Future[A]

Runs the passed function in using a Connection with a new transaction. The connection is closed and the transaction is committed at the end or rolled back in case of failures.

Runs the passed function in using a Connection with a new transaction. The connection is closed and the transaction is committed at the end or rolled back in case of failures.

Attributes

Concrete fields

val connectionFactory: ConnectionFactory