fix(database): move database file to storage dir

This commit is contained in:
2026-02-09 23:23:24 +01:00
parent 205b70eeab
commit 7c5d319043
3 changed files with 16 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ package database
import (
"database/sql"
"log"
"path/filepath"
_ "github.com/glebarez/go-sqlite"
)
@@ -11,8 +12,8 @@ const FILENAME string = "storage.db"
var database *sql.DB
func OpenSQLite() error {
db, err := sql.Open("sqlite", FILENAME)
func OpenSQLite(basepath string) error {
db, err := sql.Open("sqlite", filepath.Join(basepath, FILENAME))
if err != nil {
return err
}