JM-WechatMini/config/gorm_mssql.go
2023-11-02 04:34:46 +08:00

15 lines
385 B
Go

package config
type Mssql struct {
GeneralDB `yaml:",inline" mapstructure:",squash"`
}
// dsn := "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm"
func (m *Mssql) Dsn() string {
return "sqlserver://" + m.Username + ":" + m.Password + "@" + m.Path + ":" + m.Port + "?database=" + m.Dbname + "&encrypt=disable"
}
func (m *Mssql) GetLogMode() string {
return m.LogMode
}