1234567891011121314151617181920212223242526272829 |
- package dialector
- import (
- "eta/eta_mini_ht_api/common/component/config"
- "gorm.io/driver/mysql"
- "gorm.io/gorm"
- )
- const (
- DriverName = "mysql"
- )
- type Mysql struct {
- mysqlConf *config.DBConfig
- }
- func (m *Mysql) GetDBName() string {
- return DriverName
- }
- func (m *Mysql) GetDial(dns string) gorm.Dialector {
- return mysql.Open(dns)
- }
- func getMysql() DBDial {
- return &Mysql{}
- }
- func init() {
- Register("mysql", getMysql)
- }
|