Package-level declarations

Types

Link copied to clipboard
@ExperimentalCoroutinesApi
class Jdbc(connectionPoolSize: Int = 10, connectionFactory: () -> Connection)
Link copied to clipboard
typealias Row = Map<String, Any?>

Functions

Link copied to clipboard
@ExperimentalCoroutinesApi
fun <T> Jdbc.batchUpdate(sql: String, upstream: Flow<T>, concurrency: Int = 1, groupStrategy: GroupStrategy = TimeWindow(100, 250.milliseconds), prepare: suspend PreparedStatement.(T) -> Unit = {}): Flow<Int>

Executes a batch update for the given SQL statement using the provided upstream Flow as input. The batch update is performed in chunks, as specified by the groupStrategy parameter, and can be executed concurrently using the specified concurrency level.

Link copied to clipboard
@ExperimentalCoroutinesApi
fun Jdbc.query(sql: String, fetchSize: Int = 100, prepare: suspend PreparedStatement.() -> Unit = {}): Flow<Row>

Executes a query for the given SQL statement using the provided fetchSize as a result set fetch size.

Link copied to clipboard
@ExperimentalCoroutinesApi
fun Jdbc.singleUpdate(sql: String, prepare: suspend PreparedStatement.() -> Unit = {}): Flow<Int>

Executes a single SQL update using a JDBC connection.

@ExperimentalCoroutinesApi
fun <T> Jdbc.singleUpdate(sql: String, upstream: Flow<T>, concurrency: Int = 1, prepare: suspend PreparedStatement.(T) -> Unit = {}): Flow<Int>

Executes a single SQL update using a JDBC connection for each item in the upstream flow.

Link copied to clipboard
@ExperimentalCoroutinesApi
inline fun <T : Any> Jdbc.typedQuery(sql: String, fetchSize: Int = 100): Flow<T>
@ExperimentalCoroutinesApi
inline fun <T : Any> Jdbc.typedQuery(sql: String, fetchSize: Int = 100, crossinline prepare: suspend PreparedStatement.() -> Unit): Flow<T>

Executes a typed query for the given SQL statement using the provided fetchSize as a result set fetch size. The resulting Flow emits objects of type T, which must have a primary constructor and whose parameters are matched with the columns of the result set.