Documentation ¶
Index ¶
- Constants
- func CreateConn(connStr string) (db *sql.DB, err error)
- func DbxDatabase() *dbx.Database
- func EngineGroup() *xorm.EngineGroup
- func ExecuteContext(ctx context.Context, fn func(*dbx.TxRunner) error) error
- func Tx(fn func(*dbx.TxRunner) error) error
- func TxContext(ctx context.Context, fn func(runner *dbx.TxRunner) error) error
- func WithValueContext(parent context.Context, runner *dbx.TxRunner) context.Context
- type BaseDao
- type DbxDatabaseStarter
- type XormDatabaseStarter
Constants ¶
View Source
const TX = "tx"
Variables ¶
This section is empty.
Functions ¶
func DbxDatabase ¶
func EngineGroup ¶
func EngineGroup() *xorm.EngineGroup
Types ¶
type DbxDatabaseStarter ¶
type DbxDatabaseStarter struct {
infra.BaseStarter
}
dbx数据库starter,并且设置为全局
func (*DbxDatabaseStarter) Setup ¶
func (s *DbxDatabaseStarter) Setup(ctx infra.StarterContext)
数据库的实例化启动生命周期晚于配置文件加载,所以放到Setup中
func (*DbxDatabaseStarter) Stop ¶ added in v0.0.12
func (s *DbxDatabaseStarter) Stop(ctx infra.StarterContext)
type XormDatabaseStarter ¶
type XormDatabaseStarter struct {
infra.BaseStarter
}
xorm数据库starter,并且设置为全局
func (*XormDatabaseStarter) Setup ¶
func (s *XormDatabaseStarter) Setup(ctx infra.StarterContext)
数据库的实例化启动生命周期晚于配置文件加载,所以放到Setup中
func (*XormDatabaseStarter) Stop ¶ added in v0.0.12
func (s *XormDatabaseStarter) Stop(ctx infra.StarterContext)
Click to show internal directories.
Click to hide internal directories.