diff --git a/internal/model/init.go b/internal/model/init.go index 72297004e0..e2effff088 100644 --- a/internal/model/init.go +++ b/internal/model/init.go @@ -19,7 +19,7 @@ func Init() *gorm.DB { panic(fmt.Sprintf("load orm conf err: %v", err)) } - DB = orm.NewMySQL(cfg) + DB = orm.New(cfg) return DB } @@ -28,7 +28,7 @@ func GetDB() *gorm.DB { return DB } -// loadConf load gorm config +// loadConf load database config func loadConf() (ret *orm.Config, err error) { var cfg orm.Config if err := config.Load("database", &cfg); err != nil { diff --git a/pkg/storage/orm/orm.go b/pkg/storage/orm/orm.go index 5ab72bcf34..f61dbd37dc 100644 --- a/pkg/storage/orm/orm.go +++ b/pkg/storage/orm/orm.go @@ -37,8 +37,8 @@ type Config struct { SlowThreshold time.Duration // 慢查询时长,默认500ms } -// NewMySQL connect to database and create a db instance -func NewMySQL(c *Config) (db *gorm.DB) { +// New connect to database and create a db instance +func New(c *Config) (db *gorm.DB) { var ( err error sqlDB *sql.DB