QueryPagingSource
Create a PagingSource that pages through results according to queries generated by queryProvider. queryProvider receives a SELECT FROM collection and should append any necessary SQL JOIN, WHERE, ORDER BY, and GROUP BY clauses.
Minimally, an ORDER BY clause should always be provided to ensure query results and paged data are consistently ordered.
Queries returned by queryProvider should expect the PagingSource to do SQL offset/limit based paging. queryProvider will be called multiple times both as a count query for total records as well as with the select statement with page offsets to retrieve documents, which are mapped to objects via the provided mapper.
Queries will be executed on context.
Parameters
CoroutineContext to execute queries on
query Select statement
collection to query
mapping function from JSON query results to objects
query provider function