Package-level declarations

Types

Link copied to clipboard
open class CustomExpr<T>(val text: String, columnType: IColumnType<T & Any>) : Function<T>

An Exposed Function that embeds raw SQL text as a typed expression in queries.

Link copied to clipboard
class KotlinSqlLogger(val logger: KLogger = ExposedUtils.logger) : SqlLogger

An Exposed SqlLogger that logs SQL statements via a Kotlin KLogger, at debug level.

Functions

Link copied to clipboard

Creates a nullable DateTime from the given SQL text.

Link copied to clipboard
fun dateTimeExpr(str: String): CustomExpr<DateTime>

Creates a non-null DateTime from the given SQL str.

Link copied to clipboard
operator fun ResultRow.get(index: Int): Any?

Retrieves a column value from this ResultRow by its zero-based field index.

Link copied to clipboard
fun <T> readonlyTx(db: Database? = null, transactionIsolation: Int? = db?.transactionManager?.defaultIsolationLevel, statement: JdbcTransaction.() -> T): T

Executes a read-only database transaction.

Link copied to clipboard
fun <T> timedReadOnlyTx(db: Database? = null, transactionIsolation: Int? = db?.transactionManager?.defaultIsolationLevel, statement: JdbcTransaction.() -> T): TimedValue<T>

Executes a read-only database transaction and measures its execution time.

Link copied to clipboard
fun <T> timedTransaction(db: Database? = null, transactionIsolation: Int? = db?.transactionManager?.defaultIsolationLevel, statement: JdbcTransaction.() -> T): TimedValue<T>

Executes a database transaction and measures its execution time.

Link copied to clipboard
fun ResultRow.toRowString(): String

Converts this ResultRow to a human-readable string by joining each column's string representation with " - ", omitting columns whose string form is empty.

Link copied to clipboard
fun <T : Table> T.upsert(conflictIndex: Index, onUpdate: UpsertBuilder.(UpdateStatement) -> Unit? = null, onUpdateExclude: List<Column<*>>? = null, where: () -> Op<Boolean>? = null, body: T.(UpsertStatement<Long>) -> Unit): UpsertStatement<Long>

Convenience overload of Exposed's native upsert that takes a unique Index as the conflict target, forwarding its columns as the keys of the underlying ON CONFLICT (...) clause. A named index definition therefore stays the single source of truth for the conflict columns.