reCoreD-UI/database/database.go

18 lines
244 B
Go
Raw Normal View History

2024-04-03 09:05:12 +00:00
package database
import (
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
2024-04-09 08:28:18 +00:00
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
2024-04-03 09:05:12 +00:00
}