Optional
cursor: stringCursor value (typically an ID) to start pagination from
Optional
limit: number = 20Number of items to retrieve
Optional
sortField: string = 'createdAt'Field to sort by for consistent ordering
Prisma query parameters for cursor-based pagination
Builds Prisma cursor-based pagination parameters for high-performance pagination.
This utility creates cursor-based pagination parameters for Prisma queries, which is more efficient than offset-based pagination for large datasets. It takes one extra item to determine if there's a next page and uses the cursor to position the query correctly.
Note: This is prepared for future implementation of cursor-based pagination as an alternative to the current offset/page-based approaches.