Documentation ¶
Index ¶
- func AlterColumnsWithMySQL(db *gorm.DB, tableName string, fields []*schema.Field) error
- func CreateIndexs(tx *gorm.DB, tableName string, idxs []schema.Index) error
- func Enabled(enabled *bool) func(tx *gorm.DB) *gorm.DB
- func ExcludeDeleted(db *gorm.DB) *gorm.DB
- func ExcludeDeletedAt(db *gorm.DB) *gorm.DB
- func ExcludeDeletedAtScope(alias string) func(db *gorm.DB) *gorm.DB
- func ExlucdeDeletedScope(alias string) func(db *gorm.DB) *gorm.DB
- func GetMonthTableName(baseTableName string) string
- func GetMonthTableNameWithYearAndMonth(baseTableName string, year int, month int) string
- func GetYearTableName(baseTableName string) string
- func GetYearTableNameWithYear(baseTableName string, year int) string
- func Paginate(page, size int) func(db *gorm.DB) *gorm.DB
- func QueryAndCount[T any](query *gorm.DB, pageIndex, pageSize int) ([]*T, int64, *errx.CodeErr)
- func Table(tableName string) func(db *gorm.DB) *gorm.DB
- func TableSubffix(tableName, subffix string) func(db *gorm.DB) *gorm.DB
- func WhereDateRange(field string, from, to interface{}) func(db *gorm.DB) *gorm.DB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlterColumnsWithMySQL ¶ added in v1.2.48
批量修改列
func CreateIndexs ¶ added in v1.2.48
批量定义索引
func ExcludeDeleted ¶ added in v1.3.3
使用deleted 标记字段排除删除内容
func ExcludeDeletedAt ¶ added in v1.3.4
使用deleted_at 字段排除删除条件
func ExcludeDeletedAtScope ¶ added in v1.3.4
使用deleted_at 字段排除删除条件并使用别名
func ExlucdeDeletedScope ¶ added in v1.3.3
使用deleted字段排除删除内容并指定表名
func GetMonthTableName ¶ added in v1.2.45
获取当前月的表名 baseTableName_yearmonth
func GetMonthTableNameWithYearAndMonth ¶ added in v1.2.46
获取指定年月的表名 baseTableName_yearmonth
func GetYearTableName ¶ added in v1.2.45
获取当前年的表名 baseTableName_year
func GetYearTableNameWithYear ¶ added in v1.2.46
获取指定年的表名 baseTableName_year
func QueryAndCount ¶ added in v1.3.11
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.