types

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: Apache-2.0 Imports: 3 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 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 WithPagination

func WithPagination(page, pageSize int) Option

func WithSearchQuery

func WithSearchQuery(q string, fields ...string) 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