JM-WechatMini/config/gorm_mysql.go

14 lines
289 B
Go
Raw Permalink Normal View History

2023-11-02 04:34:46 +08:00
package config
type Mysql struct {
GeneralDB `yaml:",inline" mapstructure:",squash"`
}
func (m *Mysql) Dsn() string {
return m.Username + ":" + m.Password + "@tcp(" + m.Path + ":" + m.Port + ")/" + m.Dbname + "?" + m.Config
}
func (m *Mysql) GetLogMode() string {
return m.LogMode
}