gormx

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderAscending  = "ascending"
	OrderAsc        = "asc"
	OrderDescending = "descending"
	OrderDesc       = "desc"
)

Variables

View Source
var Unscoped = func(db *gorm.DB) *gorm.DB { return db.Unscoped() }

Functions

func Alias

func Alias(fd field.Expr) string

func CamelToSnake

func CamelToSnake(s string) string

CamelToSnake 驼峰转换为下划线

func DynamicSort

func DynamicSort(tableName, sortBy, sortOrder string, defaultSort ...field.Expr) field.Expr

func DynamicSortAgg

func DynamicSortAgg(tableName, sortBy, sortOrder string,
	aggFunc func(field.Field) field.Field,
	defaultSort ...field.Expr) field.Expr

DynamicSortAgg order := DynamicSortAgg(q.TableName(), in.SortBy, in.SortOrder, func(f field.Field) field.Field { return f.Sum() }, q.ProductID.Desc())

func ILike

func ILike(column *string) string

func ILikeHelper

func ILikeHelper(column string) string

func InitDB

func InitDB() *gorm.DB

func Page

func Page[T int | int8 | int16 | int32 | int64](current, pageSize T) (offset, limit int)

Types

This section is empty.

Directories

Path Synopsis
source
g

Jump to

Keyboard shortcuts

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