quickSelect

fun <T : KQLiteTable> T.quickSelect(vararg columns: KQLiteColumn<*>, connection: SQLiteConnection? = null, where: Clause.(T) -> Unit? = null): KQLiteCursor

A convenience function for performing a simple SELECT query.

This function allows for a quick selection of columns from the table with an optional WHERE clause. For more complex queries involving JOIN, GROUP BY, ORDER BY, etc., use the select function to build the statement.

Example

// Selects first name and age from the Employees table where
// age is greater than 18
val cursor = Employees.quickSelect(Employees.firstName, Employees.age) {
Employees.age GT 18
}

// Selects all columns from the Employees table
Employees.quickSelect().forEach {
println(it[Employees.firstName])
}

Return

A KQLiteCursor containing the result set of the query.

Receiver

The KQLiteTable instance to select from.

Author

MOHAMMAD AZIM ANSARI

Parameters

columns

The columns to be retrieved from the table. If no columns are specified, all columns (*) will be selected.

connection

An optional SQLiteConnection to use for executing the query. If null, a default connection is used.

where

A lambda block to construct the WHERE clause for the query. It is optional.

Type Parameters

T

The type of the KQLiteTable this query is being performed on.

See also