Package-level declarations

Types

Link copied to clipboard
abstract class DatabaseBuilder

Abstract builder class for constructing a DatabaseProvider.

Link copied to clipboard
data class DatabaseConfig(val driver: String, val url: String, val user: String = "", val password: String = "")

Data class representing the configuration for a database connection.

Link copied to clipboard
annotation class DatabaseDsl

Marker annotation for Database DSL.

Link copied to clipboard

Interface for abstracting database access.

Link copied to clipboard
interface Repository<ID : Comparable<ID>, E : Entity<ID>>

Interface for DAO-based repositories.

Functions

Link copied to clipboard
fun <T> dbQuery(database: Database? = null, statement: Transaction.() -> T): T

Executes a transaction synchronously.

Link copied to clipboard
suspend fun <T> dbQuerySuspend(database: Database? = null, statement: suspend 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.

Link copied to clipboard
fun <T : Table, R> T.query(provider: DatabaseProvider, statement: Transaction.(T) -> R): R

Extension function for Table to execute a query within its context.

Link copied to clipboard
suspend fun <T : Table, R> T.querySuspend(provider: DatabaseProvider, statement: Transaction.(T) -> R): R

Extension function for Table to execute an asynchronous query within its context.