Query

abstract class Query<out RowType : Any>(queries: MutableList<Query<*>>, mapper: (SqlCursor) -> RowType)

A listenable, typed query generated by SQLDelight.

Parameters

RowType

the type that this query can map its result set to.

Constructors

Query
Link copied to clipboard
common
fun <out RowType : Any> Query(queries: MutableList<Query<*>>, mapper: (SqlCursor) -> RowType)
the type that this query can map its result set to.

Types

Listener
Link copied to clipboard
common
interface Listener
An interface for listening to changes in the result set of a query.

Functions

addListener
Link copied to clipboard
common
fun addListener(listener: Query.Listener)
Register a listener to be notified of future changes in the result set.
execute
Link copied to clipboard
common
abstract fun execute(): SqlCursor
Execute the underlying statement.
executeAsList
Link copied to clipboard
common
fun executeAsList(): List<RowType>
executeAsOne
Link copied to clipboard
common
fun executeAsOne(): RowType
executeAsOneOrNull
Link copied to clipboard
common
fun executeAsOneOrNull(): RowType?
notifyDataChanged
Link copied to clipboard
common
fun notifyDataChanged()
Notify listeners that their current result set is staled.
removeListener
Link copied to clipboard
common
fun removeListener(listener: Query.Listener)
Remove a listener to no longer be notified of future changes in the result set.

Properties

mapper
Link copied to clipboard
common
val mapper: (SqlCursor) -> RowType
The mapper this Query was created with, which can convert a row in the SQL cursor returned by execute to RowType.