Documentation ¶
Index ¶
Constants ¶
View Source
const ( SQLModeDebug = "debug" SQLModeRelease = "release" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.0.6
type Config struct { Usage string // use to manage connection RunMode string // debug, release DSN string // root:root@tcp(127.0.0.1:3306) Database string // default database MaxIdleConn int MaxOpenConn int MaxLifeTime int }
Config init config
type Manager ¶ added in v1.0.6
type Manager struct {
// contains filtered or unexported fields
}
Manager store all gorm db engine according to the config usage key
func (*Manager) Default ¶ added in v1.0.6
Default return default engine, default is the first config in configs
func (*Manager) MustUse ¶ added in v1.0.6
MustUse return default engine, default is the first config in configs, if err, got panic
func (*Manager) SetWriters ¶ added in v1.0.6
SetWriters set gorm log writers, default is stdout
type OpenTracingPlugin ¶ added in v1.0.6
type OpenTracingPlugin struct{}
func (*OpenTracingPlugin) Initialize ¶ added in v1.0.6
func (op *OpenTracingPlugin) Initialize(db *gorm.DB) (err error)
func (*OpenTracingPlugin) Name ¶ added in v1.0.6
func (op *OpenTracingPlugin) Name() string
type SQL ¶ added in v1.0.6
type SQL struct {
// contains filtered or unexported fields
}
func MockSQLTesting ¶ added in v1.0.6
Click to show internal directories.
Click to hide internal directories.