SQLiteStatement

SQLite Statement

Describes a SQLite query statement, potentially in prepared form, which can be executed against an active SQLite database connection.

This type is typically created by the SQLiteDatabase interface, as driven by user code, and then either executed in one-shot form, or in repeated (prepared) form, as needed.

SQLite statements hold their own resources, so they are Closeable and AutoCloseable; all statement except simple one-shot statements are managed by their owning SQLiteDatabase instance.

As a result, calling SQLiteDatabase.close will call close on any owned statements.

See also

SQLite Database API

Functions

Link copied to clipboard
abstract fun all(vararg args: Any?): List<SQLiteObject>

Execute the underlying statement against the owning SQLiteDatabase; then, build a List of all results, with each structured as a map-like SQLiteObject.

Link copied to clipboard
abstract override fun close()
Link copied to clipboard
abstract fun finalize()

Close this statement, releasing any resources held by it; this method is called automatically by the owning database when it is closed, but may also be called earlier by the user on-demand.

Link copied to clipboard
abstract fun get(vararg args: Any?): SQLiteObject?

Execute the underlying statement against the owning SQLiteDatabase; then, build a single result, structured as a map-like SQLiteObject.

Link copied to clipboard
abstract fun prepare(args: Array<out Any?>? = null): PreparedStatement

Prepare this statement with the provided args (as applicable), rendering if needed; successive calls to this method may skip superfluous work.

Link copied to clipboard
abstract fun run(vararg args: Any?)

Execute the underlying statement against the owning SQLiteDatabase; this method is optimized for one-shot execution, or execution of queries without results (such as inserts, updates, deletes, and schema changes).

Link copied to clipboard
abstract fun unwrap(): Statement

Unwrap this statement into a JDBC Statement; this method is provided for host-side use only.

Link copied to clipboard
abstract fun values(vararg args: Any?): List<List<Any?>>

Execute the underlying statement against the owning SQLiteDatabase; then, build a List of all results, with each structured as an array of values, with order preserved for the requested table columns.