sqldelight-runtime / com.squareup.sqldelight / Transacter / Transaction

Transaction

abstract class Transaction

A SQL transaction. Can be created through the driver via SqlDriver.newTransaction or through an implementation of Transacter by calling Transacter.transaction.

Constructors

<init>

Transaction()

A SQL transaction. Can be created through the driver via SqlDriver.newTransaction or through an implementation of Transacter by calling Transacter.transaction.

Properties

enclosingTransaction

abstract val enclosingTransaction: Transaction?

The parent transaction, if there is any.

Functions

afterCommit

fun afterCommit(function: () -> Unit): Unit

Queues function to be run after this transaction successfully commits.

afterRollback

fun afterRollback(function: () -> Unit): Unit

Queues function to be run after this transaction rolls back.

endTransaction

abstract fun endTransaction(successful: Boolean): Unit

Signal to the underlying SQL driver that this transaction should be finished.

rollback

fun rollback(): Nothing

Rolls back this transaction.

transaction

fun transaction(body: Transaction.() -> Unit): Unit

Begin an inner transaction.