Query

abstract class Query<out RowType : Any>(mapper: (SqlCursor) -> RowType) : ExecutableQuery<RowType>

A listenable, typed query generated by SQLDelight.

Parameters

RowType

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

Constructors

Link copied to clipboard
fun <out RowType : Any> Query(mapper: (SqlCursor) -> RowType)

Types

Link copied to clipboard
interface Listener

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

Functions

Link copied to clipboard
abstract fun addListener(listener: Query.Listener)

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

Link copied to clipboard
abstract fun <R> execute(mapper: (SqlCursor) -> R): QueryResult<R>

Execute the underlying statement. The resulting cursor is passed to the given block.

Link copied to clipboard
fun executeAsList(): List<RowType>
Link copied to clipboard
fun executeAsOne(): RowType
Link copied to clipboard
fun executeAsOneOrNull(): RowType?
Link copied to clipboard
abstract fun removeListener(listener: Query.Listener)

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

Properties

Link copied to clipboard
val mapper: (SqlCursor) -> RowType