KilnDriver

Functions

Link copied to clipboard
abstract fun addListener(vararg queryKeys: String, listener: KilnListener)
Link copied to clipboard
abstract override fun close()
Link copied to clipboard
Link copied to clipboard
abstract fun execute(identifier: Int?, sql: String, parameters: Int, binders: KilnPreparedStatement.() -> Unit? = null): Long
Link copied to clipboard
abstract fun <R> executeQuery(identifier: Int?, sql: String, mapper: (KilnCursor) -> R, parameters: Int, binders: KilnPreparedStatement.() -> Unit? = null): R
Link copied to clipboard
Link copied to clipboard
abstract fun notifyListeners(vararg queryKeys: String)
Link copied to clipboard
suspend fun KilnDriver.notifyOrDefer(tableName: String)

Inside a transaction, records tableName as dirty so its notification is sent once, after the outermost commit — or not at all if the transaction rolls back. Outside a transaction, calls KilnDriver.notifyListeners immediately (preserving the existing per-operation behaviour).

Link copied to clipboard
abstract fun removeListener(vararg queryKeys: String, listener: KilnListener)
Link copied to clipboard
suspend fun KilnDriver.withTransaction(context: CoroutineContext = Dispatchers.Default, block: suspend () -> Unit)

Executes block inside a single SQLite transaction.

Link copied to clipboard
suspend fun <T> KilnDriver.withTransactionAwareContext(context: CoroutineContext, block: suspend CoroutineScope.() -> T): T

Runs block like withContext(context, block), unless a transaction is open: