netplay-lobby-server-go/model/mysql.go
2024-12-24 22:09:17 +08:00

12 lines
244 B
Go

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)
}