PreparedStatementParameters

Exposes the API to bind values to a PreparedStatement's parameters.

Binding Values To Prepared Statements

Properties

Link copied to clipboard
abstract val count: Int

Number of parameters that can be bound to.

Functions

Link copied to clipboard

Sets value as the value for the parameter at index, 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 bindBoolean that binds null when value is null.

Link copied to clipboard
abstract fun bindBuffer(index: Int, value: Buffer, size: Long = value.byteSize, cleanup: (Buffer) -> Unit? = null)

Sets the bytes buffer value as the value for the parameter at index.

Link copied to clipboard
fun PreparedStatementParameters.bindBuffer(index: Int, value: Buffer?, cleanup: (Buffer) -> Unit? = null)

Convenience overload of bindBuffer that binds null when value is null.

Link copied to clipboard
abstract fun bindByteArray(index: Int, value: ByteArray, size: Int = value.size)

Sets the bytes buffer value as the value for the parameter at index.

Link copied to clipboard
fun PreparedStatementParameters.bindByteArray(index: Int, value: ByteArray?, size: Int = value?.size ?: 0)

Convenience overload of bindByteArray that binds null when value is null.

Link copied to clipboard
abstract fun bindDouble(index: Int, value: Double)

Sets the 64-bit floating point value as the value for the parameter at index.

Link copied to clipboard

Convenience overload of bindDouble that binds null when value is null.

Link copied to clipboard
abstract fun bindInt(index: Int, value: Int)

Sets the 32-bit signed integer value as the value for the parameter at index.

Link copied to clipboard

Convenience overload of bindInt that binds null when value is null.

Link copied to clipboard
abstract fun bindLong(index: Int, value: Long)

Sets the 64-bit signed integer value as the value for the parameter at index.

Link copied to clipboard

Convenience overload of bindLong that binds null when value is null.

Link copied to clipboard
abstract fun bindNull(index: Int)

Sets null as the value for the parameter at index.

Link copied to clipboard
abstract fun bindPointer(index: Int, value: Any, type: String? = null)

Sets value as the value for the parameter at index.

Link copied to clipboard
fun PreparedStatementParameters.bindPointer(index: Int, value: Any?, type: String? = null)

Convenience overload of bindPointer that binds null when value is null.

Link copied to clipboard
abstract fun bindString(index: Int, value: String)

Sets the text value as the UTF-8 encoded value for the parameter at index.

Link copied to clipboard

Convenience overload of bindString that binds null when value is null.

Link copied to clipboard
abstract fun bindText(index: Int, value: Buffer, encoding: SqliteTextEncoding.BindText, size: Long = value.byteSize, cleanup: (Buffer) -> Unit? = null)

Sets the text buffer value, interpreted using encoding, as the value for the parameter at index.

Link copied to clipboard
fun PreparedStatementParameters.bindText(index: Int, value: Buffer?, encoding: SqliteTextEncoding.BindText, size: Long = value?.byteSize ?: 0L, cleanup: (Buffer) -> Unit? = null)

Convenience overload of bindText that binds null when value is null.

Link copied to clipboard
abstract fun bindValue(index: Int, value: Value)

Sets value as the value for the parameter at index. value can be a protected or unprotected SQLite value.

Link copied to clipboard

Convenience overload of bindValue that binds null when value is null.

Link copied to clipboard
abstract fun bindZeroBlob(index: Int, size: Int)

Sets the value for the parameter at index to be a buffer of size bytes, all set to zero.

abstract fun bindZeroBlob(index: Int, size: Long)

Overload of bindZeroBlob for sizes larger than Int.MAX_VALUE.

Link copied to clipboard
abstract fun clear()

Resets all parameters to null.

Link copied to clipboard
abstract fun getIndex(name: String): Int

Returns the index of the parameter named name, or 0 if there is no matching parameter.

Link copied to clipboard
abstract fun getName(index: Int): String?

Returns the name of the parameter at index, or null if it is unnamed or index is out of range.