lure/db.go
Arsen Musayelyan 0144ad17d9
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Move database open code into internal/db
2023-01-11 14:14:31 -08:00

19 lines
311 B
Go

package main
import (
"github.com/jmoiron/sqlx"
"go.arsenm.dev/logger/log"
"go.arsenm.dev/lure/internal/config"
"go.arsenm.dev/lure/internal/db"
)
var gdb *sqlx.DB
func init() {
var err error
gdb, err = db.Open(config.DBPath)
if err != nil {
log.Fatal("Error opening database").Err(err).Send()
}
}