Pagination
struct Pagination
Normalizes the common start and limit URL query parameters before they are used to build database ranges.
-
The normalized index of the first item to return.
Declaration
Swift
let start: Int -
The normalized maximum number of items to return.
Declaration
Swift
let limit: Int -
The range to apply to a database query.
Declaration
Swift
var range: Range<Int> { get } -
Creates pagination values from decoded query parameters.
Declaration
Swift
init( start: Int?, limit: Int?, defaultStart: Int = 0, defaultLimit: Int = 50, maxPageSize: Int ) -
Decodes and normalizes pagination values from a request’s URL query.
Declaration
Swift
init( on req: Request, defaultStart: Int = 0, defaultLimit: Int = 50, maxPageSize: Int )
View on GitHub