Gorm plugin to add pagination to your select queries
go get -u -v github.com/manuelarte/pagorminator
DB.Use(pagorminator.PaGormMinator{})
var products []*Products
pageRequest, err := pagorminator.PageRequest(0, 10)
DB.Clauses(pageRequest).First(&products)
The plugin will calculate the total amount of elements so then the fields total amounts
and total pages
can be used too.
Simple query with no filters (where clause)
Using where to filter
Unpaged query