dbx

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDao

func GetDao(alias string) *zorm.DBDao

func GetDefaultDao

func GetDefaultDao() *zorm.DBDao

func InitConn

func InitConn(cfgs ...Config) (err error)

Types

type CommonEntity

type CommonEntity struct {
	zorm.EntityStruct

	Id        int64     `column:"id"`         // 主健
	CreatedAt time.Time `column:"created_at"` // 创建时间
	CreatedBy int64     `column:"created_by"` // 创建时间
	UpdatedAt time.Time `column:"updated_at"` // 更新时间
	UpdatedBy int64     `column:"updated_by"` // 更新时间
	DeletedAt time.Time `column:"deleted_at"` // 删除时间
	DeletedBy int64     `column:"deleted_by"` // 删除时间
}

func (*CommonEntity) FromModel

func (entity *CommonEntity) FromModel(modelPtr any) error

func (*CommonEntity) ToModel

func (entity *CommonEntity) ToModel(modelPtr any) error

type Config

type Config struct {
	Alias                 string `mapstructure:"alias"`
	Driver                string `mapstructure:"driver"`
	Dialect               string `mapstructure:"dialect"`
	DSN                   string `mapstructure:"dsn"`
	SlowSQLMillis         int    `mapstructure:"slow-sql-millis"`
	MaxOpenConns          int    `mapstructure:"max-open-conns"`
	MaxIdleConns          int    `mapstructure:"max-idle-conns"`
	ConnMaxLifetimeSecond int    `mapstructure:"conn-max-lifetime-second"`
}

Jump to

Keyboard shortcuts

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