selectPagingSource

fun selectPagingSource(where: Where<T>? = null, orderBy: List<OrderBy<T>> = emptyList(), initialOffset: Int = 0, expiresAfter: Instant? = null): PagingSource<Int, T>(source)

Create a PagingSource that pages through results according to queries generated from the passed in where and orderBy. initialOffset initial offset to start paging from.

Queries are executed on Sqkon's internal read dispatcher.

Note: Offset paging is not very efficient on large datasets. Use wisely — for large or infinite-scroll lists prefer selectKeysetPagingSource, which avoids OFFSET's per-page row-skipping (see its docs for the per-page scan cost).

Parameters

expiresAfter

null ignores expiresAt, will not return any row which has expired set and is before expiresAfter. This is normally Clock.System.now.