sqldelight-runtime / com.squareup.sqldelight / Query

Query

abstract class Query<out RowType : Any>

A listenable, typed query generated by SQLDelight.

Parameters

RowType - the type that this query can map it's result set to.

Types

Listener

interface Listener

An interface for listening to changes in the result set of a query.

Constructors

<init>

Query(queries: MutableList<Query<*>>, mapper: (SqlCursor) -> RowType)

A listenable, typed query generated by SQLDelight.

Properties

mapper

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.

Functions

addListener

fun addListener(listener: Listener): Unit

Register a listener to be notified of future changes in the result set.

execute

abstract fun execute(): SqlCursor

Execute the underlying statement.

executeAsList

fun executeAsList(): List<RowType>

executeAsOne

fun executeAsOne(): RowType

executeAsOneOrNull

fun executeAsOneOrNull(): RowType?

notifyDataChanged

fun notifyDataChanged(): Unit

Notify listeners that their current result set is staled.

removeListener

fun removeListener(listener: Listener): Unit

Remove a listener to no longer be notified of future changes in the result set.