Help us shape the future of Go! Take the 2026 Go Developer Survey

dbquery

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PageWithDefaults

func PageWithDefaults(page *filter.Page)

PageWithDefaults sets default values for a Page object (in place).

func Paginate

func Paginate(page filter.Page) func(db *gorm.DB) *gorm.DB

Paginate is a Scope function that returns a function that paginates a database query.

func PaginatedQuery

func PaginatedQuery[T any](ctx context.Context, page filter.Page, db *gorm.DB, scopes ...func(tx *gorm.DB) *gorm.DB) (*models.PagedResult[T], error)

PaginatedQuery is a generic function for getting paginated results from a database.

func Preload

func Preload(name string) func(*gorm.DB) *gorm.DB

Preload is a scope function that preloads a relation.

func UserID

func UserID(id string) func(*gorm.DB) *gorm.DB

UserID is a scope function that filters by user ID.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL