fix(database): move database file to storage dir

This commit is contained in:
tueem committed 2026-02-09 23:23:24 +01:00
1 parent 205b70eeab
commit 7c5d319043
3 files changed
+16 -12

No files matched your search

+3 -2
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
}