chore: move to go folder

This commit is contained in:
Nicolas Meienberger
2025-08-20 22:15:43 +02:00
parent 83b4296cfc
commit a0be690eb9
21 changed files with 0 additions and 0 deletions

22
go/internal/db/db.go Normal file
View File

@@ -0,0 +1,22 @@
// Package db provides database access for the Ironmount application
package db
import (
"github.com/glebarez/sqlite"
"gorm.io/gorm"
)
var DB, err = gorm.Open(sqlite.Open("file:ironmount.db"), &gorm.Config{})
// InitDB initializes the database and creates the volumes table if it doesn't exist
func InitDB() {
if err != nil {
panic(err)
}
err = DB.AutoMigrate(&Volume{})
if err != nil {
panic(err)
}
}