utils

package
v1.0.45 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyAliasToColumn

func ApplyAliasToColumn(stmt string, alias string) string

ApplyAliasToColumn 设置别名,返回类似 COUNT(*) as cnt 这样的

func CaseRunInMemDB

func CaseRunInMemDB(run func(db *gorm.DB))

func PtrX

func PtrX[T any](v T) *T

PtrX 给任何值取地址,特别是当参数为数字0,1,2,3或者字符串"a", "b", "c"的时候

func VOr0

func VOr0[T any](v *T) T

VOr0 给任何地址取值,当是空地址时返回 zero 即类型默认的零值

Types

type ColumnNameInterface

type ColumnNameInterface interface {
	Name() string
}

type GormTableNameFace

type GormTableNameFace interface {
	TableName() string
}

type TableNameImp

type TableNameImp struct {
	// contains filtered or unexported fields
}

func NewTableNameImp

func NewTableNameImp(tableName string) *TableNameImp

func (*TableNameImp) TableName

func (X *TableNameImp) TableName() string

Jump to

Keyboard shortcuts

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