gormx

package
v1.3.14 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlterColumnsWithMySQL added in v1.2.48

func AlterColumnsWithMySQL(db *gorm.DB, tableName string, fields []*schema.Field) error

批量修改列

func CreateIndexs added in v1.2.48

func CreateIndexs(tx *gorm.DB, tableName string, idxs []schema.Index) error

批量定义索引

func Enabled added in v1.2.74

func Enabled(enabled *bool) func(tx *gorm.DB) *gorm.DB

func ExcludeDeleted added in v1.3.3

func ExcludeDeleted(db *gorm.DB) *gorm.DB

使用deleted 标记字段排除删除内容

func ExcludeDeletedAt added in v1.3.4

func ExcludeDeletedAt(db *gorm.DB) *gorm.DB

使用deleted_at 字段排除删除条件

func ExcludeDeletedAtScope added in v1.3.4

func ExcludeDeletedAtScope(alias string) func(db *gorm.DB) *gorm.DB

使用deleted_at 字段排除删除条件并使用别名

func ExlucdeDeletedScope added in v1.3.3

func ExlucdeDeletedScope(alias string) func(db *gorm.DB) *gorm.DB

使用deleted字段排除删除内容并指定表名

func GetMonthTableName added in v1.2.45

func GetMonthTableName(baseTableName string) string

获取当前月的表名 baseTableName_yearmonth

func GetMonthTableNameWithYearAndMonth added in v1.2.46

func GetMonthTableNameWithYearAndMonth(baseTableName string, year int, month int) string

获取指定年月的表名 baseTableName_yearmonth

func GetYearTableName added in v1.2.45

func GetYearTableName(baseTableName string) string

获取当前年的表名 baseTableName_year

func GetYearTableNameWithYear added in v1.2.46

func GetYearTableNameWithYear(baseTableName string, year int) string

获取指定年的表名 baseTableName_year

func Paginate

func Paginate(page, size int) func(db *gorm.DB) *gorm.DB

func QueryAndCount added in v1.3.11

func QueryAndCount[T any](query *gorm.DB, pageIndex, pageSize int) ([]*T, int64, *errx.CodeErr)

func Table added in v1.2.45

func Table(tableName string) func(db *gorm.DB) *gorm.DB

func TableSubffix

func TableSubffix(tableName, subffix string) func(db *gorm.DB) *gorm.DB

func WhereDateRange added in v1.2.42

func WhereDateRange(field string, from, to interface{}) func(db *gorm.DB) *gorm.DB

from/to 非值类型

Types

This section is empty.

Jump to

Keyboard shortcuts

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