Package-level declarations

Functions

Link copied to clipboard
fun <Key : Any, RowType : Any> QueryPagingSource(transacter: TransacterBase, context: CoroutineContext, pageBoundariesProvider: (anchor: Key?, limit: Long) -> Query<Key>, queryProvider: (beginInclusive: Key, endExclusive: Key?) -> Query<RowType>): PagingSource<Key, RowType>

Create a PagingSource that pages through results according to queries generated by queryProvider. Queries returned by queryProvider should expected to do keyset paging. For that reason, queries should be arranged by an non-ambigious ORDER BY clause. Key must be a unique clause that rows are ordered by. For performance reasons, an index should be present on Key.

@JvmName(name = "QueryPagingSourceInt")
fun <RowType : Any> QueryPagingSource(countQuery: Query<Int>, transacter: TransacterBase, context: CoroutineContext, queryProvider: (limit: Int, offset: Int) -> Query<RowType>, initialOffset: Int = 0): PagingSource<Int, RowType>

Create a PagingSource that pages through results according to queries generated by queryProvider. Queries returned by queryProvider should expect to do SQL offset/limit based paging. For that reason, countQuery is required to calculate pages and page offsets. initialOffset initial offset to start paging from.

@JvmName(name = "QueryPagingSourceLong")
fun <RowType : Any> QueryPagingSource(countQuery: Query<Long>, transacter: TransacterBase, context: CoroutineContext, queryProvider: (limit: Long, offset: Long) -> Query<RowType>, initialOffset: Long = 0): PagingSource<Int, RowType>

Variant of QueryPagingSource that accepts a Long instead of an Int for countQuery , queryProvider and initialOffset.