loadAllEntriesByPaging method
Future<DataPageQueryResult<T> >
loadAllEntriesByPaging({
- required DataPageQuery<
T> pageQuery, - ConditionQuery where(
- T model
- List<
FieldOrder> orderBy(- T model
- List<
FieldWithValue> desiredFields(- T model
Make query with pagination.
Implementation
Future<DataPageQueryResult<T>> loadAllEntriesByPaging(
{required DataPageQuery<T> pageQuery,
ConditionQuery Function(T model)? where,
List<FieldOrder> Function(T model)? orderBy,
List<FieldWithValue> Function(T model)? desiredFields}) async {
int count = await countEntries(where: where);
return DataPageQueryResult<T>(
count,
await select(
limit: pageQuery.resultsPerPage,
offset: (pageQuery.page - 1) * pageQuery.resultsPerPage,
where: where,
orderBy: orderBy,
desiredFields: desiredFields),
pageQuery.page,
pageQuery.resultsPerPage);
}