Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
class MySQL(url: String, username: String, password: String, options: ConnectionPool.Options = ConnectionPool.Options(), val encoders: ValueEncoderRegistry = ValueEncoderRegistry()) : IMySQL

The MySQL class provides a driver implementation for interacting with a MySQL database. It supports connection pooling, transactional operations, and executing SQL queries.

class MySQL(url: String, username: String, password: String, options: ConnectionPool.Options = ConnectionPool.Options(), val encoders: ValueEncoderRegistry = ValueEncoderRegistry()) : IMySQL

The MySQL class provides a driver implementation for interacting with a MySQL database. It supports connection pooling, transactional operations, and executing SQL queries.

Functions

Link copied to clipboard
expect fun mySQL(url: String, username: String, password: String, options: ConnectionPool.Options = ConnectionPool.Options(), encoders: ValueEncoderRegistry = ValueEncoderRegistry()): IMySQL
actual fun mySQL(url: String, username: String, password: String, options: ConnectionPool.Options, encoders: ValueEncoderRegistry): IMySQL
actual fun mySQL(url: String, username: String, password: String, options: ConnectionPool.Options, encoders: ValueEncoderRegistry): IMySQL
Link copied to clipboard
suspend fun <T> QueryExecutor.withReadBackTransaction(block: suspend (QueryExecutor) -> Result<T>): Result<T>

Runs block, a write and the read back of the row it wrote, in a single transaction: this executor itself when it is one, else one begun on it (on a connection of its own, when a pool), committed when block succeeds and rolled back when it fails.

Link copied to clipboard
suspend fun <T> QueryExecutor.withSingleConnection(block: suspend (QueryExecutor) -> Result<T>): Result<T>

Runs block on a single database connection: this executor itself when it already is one (a connection or a transaction), or a connection borrowed from it for the duration of block when it is a pool.