mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-06 05:48:18 +08:00
18 lines
284 B
Go
18 lines
284 B
Go
package db
|
|
|
|
import (
|
|
"github.com/1Panel-dev/1Panel/backend/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
|
|
}
|
|
}
|