mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2024-11-24 11:09:16 +08:00
17 lines
262 B
Go
17 lines
262 B
Go
package db
|
|
|
|
import (
|
|
"github.com/1Panel-dev/1Panel/backend/global"
|
|
"gorm.io/driver/sqlite"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func Init() {
|
|
s := global.CONF.Sqlite
|
|
db, err := gorm.Open(sqlite.Open(s.Dsn()), &gorm.Config{})
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
global.DB = db
|
|
}
|