added workflow
All checks were successful
build / windows (push) Successful in 2m32s
build / linux (push) Successful in 1m52s

Reviewed-on: #1
This commit is contained in:
2025-03-03 13:30:39 +01:00
parent 59adc0f698
commit 0f710b8d9f
4 changed files with 63 additions and 7 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)
}