finalize workflow
Some checks failed
build / linux (push) Has been cancelled
build / windows (push) Has been cancelled

This commit is contained in:
2025-03-03 13:29:40 +01:00
parent db6e9b162f
commit 16228eba7b
2 changed files with 31 additions and 25 deletions

View File

@ -2,6 +2,8 @@ package model
import (
"log"
"os"
"path"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
@ -20,7 +22,11 @@ type SubThing struct {
}
func InitDB() *gorm.DB {
db, err := gorm.Open(sqlite.Open("things.db"))
home, err := os.UserHomeDir()
if err != nil {
panic(err)
}
db, err := gorm.Open(sqlite.Open(path.Join(home, "things.db")))
if err != nil {
log.Panic(err)
}