dbquery

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 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