From e8601eeaabb4f7384aeb39545bbdf28f90a6923d Mon Sep 17 00:00:00 2001 From: SystemGlitch Date: Mon, 19 Sep 2022 16:34:17 +0200 Subject: [PATCH] Document ScopeUnpaginated --- settings.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/settings.go b/settings.go index 986610c..8cdc3fd 100644 --- a/settings.go +++ b/settings.go @@ -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)