Skip to content

Commit

Permalink
Document ScopeUnpaginated
Browse files Browse the repository at this point in the history
  • Loading branch information
System-Glitch committed Sep 19, 2022
1 parent 2e62627 commit e8601ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func (s *Settings) Scope(db *gorm.DB, request *goyave.Request, dest interface{})
return paginator, paginator.Find()
}

// ScopeUnpaginated apply all filters, sorts and joins defined in the request's data to the given `*gorm.DB`
// without any pagination.
// Returns the `*gorm.DB` result, which can be used to check for database errors.
// The records will be added in the given `dest` slice.
// The given request is expected to be validated using `ApplyValidation`.
func (s *Settings) ScopeUnpaginated(db *gorm.DB, request *goyave.Request, dest interface{}) *gorm.DB {
db, schema, hasJoins := s.scopeCommon(db, request, dest)
db = s.scopeSort(db, request, schema)
Expand Down

0 comments on commit e8601ee

Please sign in to comment.