gormx

package
v0.5.0-gz3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 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 added in v1.0.1

func Alias(fd field.Expr) string

func CamelToSnake added in v0.5.0

func CamelToSnake(s string) string

CamelToSnake 驼峰转换为下划线

func DynamicSort added in v0.5.0

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

func DynamicSortAgg added in v1.0.1

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 added in v0.4.5

func ILike(column *string) string

func ILikeHelper added in v0.4.5

func ILikeHelper(column string) string

func InitDB

func InitDB() *gorm.DB

func Page added in v0.4.5

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