1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 16:29:17 +08:00
1Panel/backend/init/db/sqlite.go
2022-08-17 09:37:30 +08:00

18 lines
276 B
Go

package db
import (
"github.com/1Panel-dev/1Panel/global"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
func SqliteGorm() *gorm.DB {
s := global.CONF.Sqlite
if db, err := gorm.Open(sqlite.Open(s.Dsn()), &gorm.Config{}); err != nil {
panic(err)
} else {
return db
}
}