Properties

Link copied to clipboard
open override val connection: DatabaseConnection

Database connection associated with the hook.

Functions

Link copied to clipboard
inline fun <C : Any> getContextOrNull(): C?

Returns the aggregate context, if any, as C.

Link copied to clipboard

Sets the result to value, using SQLite's own convention for booleans, 1 for true and 0 for false, since SQLite has no dedicated boolean storage class.

Convenience overload of resultBoolean that returns null when value is null.

Link copied to clipboard
open override fun resultBuffer(value: Buffer, size: Long = value.byteSize, cleanup: (Buffer) -> Unit? = null): Result

Sets the bytes buffer value as the result.

Link copied to clipboard
fun ResultScope.resultBuffer(value: Buffer?, size: Long = value?.byteSize ?: 0L, cleanup: (Buffer) -> Unit? = null): Result

Convenience overload of resultBuffer that returns null when value is null.

Link copied to clipboard
open override fun resultByteArray(value: ByteArray, size: Int = value.size): Result

Sets the bytes buffer value as the result.

Link copied to clipboard

Convenience overload of resultByteArray that returns null when value is null.

Link copied to clipboard
open override fun resultDouble(value: Double): Result

Sets the 64-bit floating point value as the result.

Link copied to clipboard

Convenience overload of resultDouble that returns null when value is null.

Link copied to clipboard
open override fun resultError(message: String, result: SqliteResultCode.Failure = SqliteResultCode.ERROR): Nothing

Fails the function call with message. Equivalent to throwing an SQLiteException with result as its error code.

Link copied to clipboard
open override fun resultErrorNoMem(): Nothing

Fails the function call, indicating that a memory allocation failed. Unlike resultError, this does not accept a message and performs no allocation of its own, so it remains safe to call even when memory is already exhausted.

Link copied to clipboard
open override fun resultErrorTooBig(): Nothing

Fails the function call with a canned "string or BLOB too big" error. Unlike resultError, this does not accept a message, since the failure is already self-explanatory and does not need one formatted.

Link copied to clipboard
open override fun resultInt(value: Int): Result

Sets the 32-bit signed integer value as the result.

Link copied to clipboard

Convenience overload of resultInt that returns null when value is null.

Link copied to clipboard
open override fun resultLong(value: Long): Result

Sets the 64-bit signed integer value as the result.

Link copied to clipboard

Convenience overload of resultLong that returns null when value is null.

Link copied to clipboard
open override fun resultNull(): Result

Sets the result as null.

Link copied to clipboard
open override fun resultPointer(value: Any, type: String? = null): Result

Sets value as the result.

Link copied to clipboard
fun ResultScope.resultPointer(value: Any?, type: String?): Result

Convenience overload of resultPointer that returns null when value is null.

Link copied to clipboard
open override fun resultString(value: String): Result

Sets the text value as the UTF-8 encoded result.

Link copied to clipboard

Convenience overload of resultString that returns null when value is null.

Link copied to clipboard
open override fun resultText(value: Buffer, encoding: SqliteTextEncoding.ResultText, size: Long = value.byteSize, cleanup: (Buffer) -> Unit? = null): Result

Sets the text buffer value, interpreted using encoding, as the result.

Link copied to clipboard
fun ResultScope.resultText(value: Buffer?, encoding: SqliteTextEncoding.ResultText, size: Long = value?.byteSize ?: 0L, cleanup: (Buffer) -> Unit? = null): Result

Convenience overload of resultText that returns null when value is null.

Link copied to clipboard
open override fun resultValue(value: Value): Result

Sets value as the result. value can be a protected or unprotected SQLite value.

Link copied to clipboard

Convenience overload of resultValue that returns null when value is null.

Link copied to clipboard
open override fun resultZeroBlob(size: Int): Result

Sets the result to be a buffer of size bytes, all set to zero.

open override fun resultZeroBlob(size: Long): Result

Overload of resultZeroBlob for sizes larger than Int.MAX_VALUE.