reCoreD-UI/database/database.go
2024-04-09 16:28:18 +08:00

18 lines
244 B
Go

package database
import (
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
var Client *gorm.DB
func Connect(DSN string) error {
var err error
Client, err = gorm.Open(mysql.Open(DSN), &gorm.Config{})
if err != nil {
return err
}
return nil
}