DatabaseProvider

Interface for abstracting database access.

Properties

Link copied to clipboard
abstract val database: Database

The JetBrains Exposed Database instance.

Link copied to clipboard
abstract val tables: List<Table>

The list of tables managed by this provider.

Functions

Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract fun <T> dbQuery(statement: Transaction.() -> T): T

Executes a transaction synchronously.

Link copied to clipboard
abstract fun <T> dbQueryAsync(statement: Transaction.() -> T): CompletableFuture<T>

Executes a transaction asynchronously using a CompletableFuture.

Link copied to clipboard
abstract suspend fun <T> dbQuerySuspend(statement: Transaction.() -> T): T

Executes a transaction asynchronously using Kotlin coroutines.

Link copied to clipboard
fun DatabaseProvider.forEachTable(statement: Transaction.(Table) -> Unit)

Executes a statement for each table registered in the provider.