go_echo_wol/database/database.go

19 lines
227 B
Go
Raw Normal View History

2023-09-02 11:47:53 +08:00
package database
import (
2023-09-02 16:05:31 +08:00
_ "modernc.org/sqlite"
2023-09-02 11:47:53 +08:00
"xorm.io/xorm"
)
var engine *xorm.Engine
2023-09-02 16:05:31 +08:00
func init() {
2023-09-02 11:47:53 +08:00
var err error
2023-09-02 16:05:31 +08:00
file := "./wol.db"
2023-09-02 11:47:53 +08:00
engine, err = xorm.NewEngine("sqlite3", file)
if err != nil {
panic(err)
}
}