Skip to content

Latest commit

 

History

History
28 lines (20 loc) · 434 Bytes

README.md

File metadata and controls

28 lines (20 loc) · 434 Bytes

gorm-paginator

Usage

go get github.com/Leukocyte-Lab/gorm-paginator
pgntr := paginator.New(page, orders, map[string]string{})

var models []*Model
result := pgntr.GenGormTransaction(dao.DB).Find(&models)
if result.Error != nil {
    // TODO: handle error
}

err := pgntr.CountPageTotal(result)
if result.Error != nil {
    // TODO: handle error
}

// return models, pgntr.Page

License

MIT