Package-level declarations

Types

Link copied to clipboard
class KotlinMapper(val kClass: KClass<*>, prefix: String = "") : RowMapper<Any>
Link copied to clipboard
class KotlinMapperFactory : RowMapperFactory

This {@link RowMapperFactory} creates a new, generic {@link KotlinMapper} for every data class used. By installing this factory, any Kotlin data class will have an automatic, implicit row mapper.

Link copied to clipboard
class KotlinPlugin(installKotlinMapperFactory: Boolean = true, enableCoroutineSupport: Boolean = false) : JdbiPlugin.Singleton

Installs Kotlin specific functionality.

Functions

Link copied to clipboard
@Beta
fun <This : SqlStatement<This>> SqlStatement<This>.bindKotlin(obj: Any): This
@Beta
fun <This : SqlStatement<This>> SqlStatement<This>.bindKotlin(prefix: String, obj: Any): This

Bind all the member properties of a given Kotlin object.

Link copied to clipboard
@Beta
fun <This : Configurable<This>, C : JdbiConfig<C>> Configurable<This>.configure(configClass: KClass<C>, configurer: Consumer<C>): This

Convenience method for Configurable.configure using Kotlin class syntax.

Link copied to clipboard
fun <T : JdbiConfig<T>> StatementContext.getConfig(kClass: KClass<T>): T

Convenience helper to use any KClass for config lookup.

Link copied to clipboard

Returns the set of qualifying annotations on the given Kotlin elements.

Link copied to clipboard
@Alpha
fun Jdbi.inCoroutineContext(handle: Handle? = null): CoroutineContext.Element

Returns a CoroutineContext.Element instance representing this Jdbi object which can be used to manage handles from this Jdbi in a coroutine context.

Link copied to clipboard
@Alpha
inline fun <R> Jdbi.inTransactionUnchecked(crossinline block: (Handle) -> R): R
@Alpha
inline fun <R> Jdbi.inTransactionUnchecked(level: TransactionIsolationLevel, crossinline block: (Handle) -> R): R

Temporary extension function for Jdbi.inTransaction.

Link copied to clipboard

Returns true if the Class object represents a Kotlin class.

Link copied to clipboard
inline fun <T : Any> ResultBearing.mapTo(): ResultIterable<T>

Use a reified parameter to map the result.

fun <T : Any> ResultBearing.mapTo(kClass: KClass<T>): ResultIterable<T>

Map to a Kotlin class.

Link copied to clipboard
fun <E : Any, X : Exception> Jdbi.useExtension(extensionType: KClass<E>, callback: ExtensionConsumer<E, X>)

A convenience method which opens an extension of the given type, and yields it to a callback. A handle is opened if needed by the extention, and closed before returning to the caller.

Link copied to clipboard
@Alpha
inline fun <E> Jdbi.useExtensionUnchecked(extensionType: Class<E>, crossinline callback: (E) -> Unit)
@Alpha
inline fun <E : Any> Jdbi.useExtensionUnchecked(extensionType: KClass<E>, crossinline callback: (E) -> Unit)

Temporary extension function for Jdbi.useExtension.

Link copied to clipboard
@Alpha
inline fun Jdbi.useHandleUnchecked(crossinline block: (Handle) -> Unit)

Temporary extension function for Jdbi.useHandle.

Link copied to clipboard
inline fun <O : Any> ResultIterable<O>.useSequence(block: (Sequence<O>) -> Unit)

Stream all the rows of the result set out with a Sequence. Handles closing of the underlying iterator.

Link copied to clipboard
@Alpha
inline fun Jdbi.useTransactionUnchecked(crossinline block: (Handle) -> Unit)
@Alpha
inline fun Jdbi.useTransactionUnchecked(level: TransactionIsolationLevel, crossinline block: (Handle) -> Unit)

Temporary extension function for Jdbi.useTransaction.

Link copied to clipboard
fun <E : Any, R, X : Exception> Jdbi.withExtension(extensionType: KClass<E>, callback: ExtensionCallback<R, E, X>): R

A convenience method which opens an extension of the given type, yields it to a callback, and returns the result of the callback. A handle is opened if needed by the extension, and closed before returning to the caller.

Link copied to clipboard
@Alpha
inline fun <E, R> Jdbi.withExtensionUnchecked(extensionType: Class<E>, crossinline callback: (E) -> R): R
@Alpha
inline fun <E : Any, R> Jdbi.withExtensionUnchecked(extensionType: KClass<E>, crossinline callback: (E) -> R): R

Temporary extension function for Jdbi.withExtension.

Link copied to clipboard
@Alpha
inline fun <R> Jdbi.withHandleUnchecked(crossinline block: (Handle) -> R): R

Temporary extension function for Jdbi.withHandle.