netplay-lobby-server-go/model/mysql.go

12 lines
244 B
Go
Raw Normal View History

2024-12-24 22:09:17 +08:00
package model
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
)
// GetMysqlDB returns a mysql interface using GORM.
func GetMysqlDB(connection string) (*gorm.DB, error) {
return gorm.Open("mysql", connection)
}