Documentation ¶
Index ¶
- Variables
- func FromContext(ctx context.Context) (*gormV1.DB, error)
- func FromGormV2Context(ctx context.Context) (*gormV2.DB, error)
- func LimitOffset(page int, perPage *int) int
- func NewContext(ctx context.Context, gdb *gormV1.DB) context.Context
- func NewGormV2Context(ctx context.Context, gdb *gormV2.DB) context.Context
- func SelectPageData(db *gormV1.DB, outData interface{}, primaryKey string, page, perPage int, ...) (total int64, err error)
- type DataBase
- type DataBaseConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// DefaultPageSize 默认页大小
DefaultPageSize = 10
)
View Source
var ( // ErrContextNotFoundGorm 上下文不存在Gorm错误 ErrContextNotFoundGorm = errors.New("上下文中没有获取到Gorm") )
Functions ¶
func FromContext ¶
FromContext 从上下文中获取Gorm
func FromGormV2Context ¶
FromGormV2Context 从上下文中获取Gorm
func NewContext ¶
NewContext 创建Gorm上下文
func NewGormV2Context ¶
NewGormV2Context 创建Gorm上下文
Types ¶
Click to show internal directories.
Click to hide internal directories.