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.

Properties

Link copied to clipboard
val fn: CPointer<CFunction<(CValue<Sqlx4kMysqlPtr>, CPointer<Sqlx4kMysqlResult>?) -> Unit>>

Functions

Link copied to clipboard
fun CPointer<Sqlx4kMysqlResult>?.executeResultOrError(): ExecuteResult
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
fun CPointer<Sqlx4kMysqlResult>?.rtOrError(): CPointer<out CPointed>
Link copied to clipboard
inline suspend fun sqlx(crossinline operation: (continuationPtr: CPointer<out CPointed>) -> Unit): CPointer<Sqlx4kMysqlResult>?
Link copied to clipboard
fun CPointer<Sqlx4kMysqlResult>?.throwIfError()
fun Sqlx4kMysqlResult.throwIfError()
Link copied to clipboard
fun Sqlx4kMysqlResult.toExecuteResult(): ExecuteResult

MySQL reports LAST_INSERT_ID() as 0 when the statement generated no id.

Link copied to clipboard
fun Sqlx4kMysqlResult.toResultSet(): ResultSet
Link copied to clipboard
inline fun <T> CPointer<Sqlx4kMysqlResult>?.use(block: (Sqlx4kMysqlResult) -> T): T
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.