types

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(db *gorm.DB) *gorm.DB

func InAscOrder

func InAscOrder(fields ...string) Option

func InDescOrder

func InDescOrder(fields ...string) Option

func WithAllPreloads added in v1.6.0

func WithAllPreloads() Option

func WithFilter

func WithFilter(field string, value ...interface{}) Option

WithFilter applies a WHERE clause for the given column. IMPORTANT: `field` MUST be a trusted, hardcoded column name. NEVER pass user-supplied strings as `field`.

func WithJoin added in v1.6.0

func WithJoin(association string, conditions ...Option) Option

WithJoin joins the given association and optionally scopes the join with conditions. Conditions are applied only to the join clause, not the outer query.

func WithNotFilter added in v1.6.0

func WithNotFilter(field string, value ...interface{}) Option

WithNotFilter applies a WHERE NOT clause for the given column. IMPORTANT: `field` MUST be a trusted, hardcoded column name. NEVER pass user-supplied strings as `field`.

func WithPagination

func WithPagination(page, pageSize int) Option

func WithPreloads added in v1.6.0

func WithPreloads(associations ...string) Option

func WithSearchQuery

func WithSearchQuery(q string, fields ...interface{}) Option

WithSearchQuery applies a WHERE clause searching `q` across multiple text fields using OR. Uses LOWER() for case-insensitive matching across SQLite and PostgreSQL. IMPORTANT: `fields` MUST be trusted, hardcoded column names. NEVER pass user-supplied strings as `fields`.

Jump to

Keyboard shortcuts

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