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

This commit is contained in:
schreifuchs committed 2025-03-03 13:29:40 +01:00
1 parent db6e9b162f
commit 16228eba7b
2 files changed
+31 -25

No files matched your search

+7 -1
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)
}