Package-level declarations

Types

Link copied to clipboard

A Sequence backed by an underlying resource (e.g., an open JDBC ResultSet) that must be released.

Link copied to clipboard
@RequiresOptIn(level = RequiresOptIn.Level.WARNING, message = "This is a delicate API and its use requires care. Make sure you fully read and understand documentation of the declaration that is marked as a delicate API.")
annotation class DelicateKueryClientApi

Marks declarations that bypass the safety mechanisms of Kuery Client (e.g. SqlBuilder.addUnsafe, which skips the compiler plugin's automatic parameter binding) and can introduce SQL injection when misused.

Link copied to clipboard

A blocking SQL client.

Link copied to clipboard
interface KueryClient

A coroutine-based SQL client.

Link copied to clipboard
@RequiresOptIn(level = RequiresOptIn.Level.ERROR, message = "This is an internal Kuery Client API. It may be changed or removed without notice, and no compatibility is guaranteed between versions.")
annotation class KueryClientInternalApi

Marks declarations that are internal to Kuery Client even though they are public for technical reasons (e.g. they are referenced by other Kuery Client modules or by code the compiler plugin generates).

Link copied to clipboard

A named SQL bind parameter: the pair of a placeholder name in Sql.body and the value bound to it.

Link copied to clipboard
interface Sql

An immutable SQL statement built by SqlBuilder: the SQL text with named placeholders and the parameters bound to them.

Link copied to clipboard
sealed interface SqlBuilder

DSL scope for building SQL.

Link copied to clipboard
annotation class SqlBuilderMarker

DslMarker for the SqlBuilder DSL.

Functions

Link copied to clipboard
inline fun <T : Any> KueryClient.FetchSpec.flow(): Flow<T>

Executes the query and emits each row converted to T, without accumulating all rows in memory.

Link copied to clipboard
inline suspend fun <T : Any> KueryClient.FetchSpec.list(): List<T>

Executes the query and returns all rows converted to T.

Link copied to clipboard

Creates a NamedSqlParameter with the given name and value.

Link copied to clipboard

Executes the query and returns each row converted to T, as a sequence that streams rows without accumulating them all in memory.

Link copied to clipboard
inline suspend fun <T : Any> KueryClient.FetchSpec.single(): T

Executes the query and returns exactly one row converted to T.

Link copied to clipboard
inline suspend fun <T : Any> KueryClient.FetchSpec.singleOrNull(): T?

Executes the query and returns at most one row converted to T, or null if the query returns no rows.

Link copied to clipboard
fun Sql(block: SqlBuilder.() -> Unit): Sql

Creates a Sql by running the given SqlBuilder block.

fun Sql(body: String, parameters: List<NamedSqlParameter> = emptyList()): Sql

Creates a Sql from the given body and parameters.

Link copied to clipboard
fun SqlBuilder.values(input: List<List<Any?>>)

Add a VALUES (...), (...) clause, binding every element as a parameter.

fun <T> SqlBuilder.values(input: List<T>, transformer: (T) -> List<Any?>)

Add a VALUES (...), (...) clause, converting each element of input into a row using transformer.