refactor: migrate env-var reads to config package

This commit is contained in:
2026-05-26 15:38:14 +02:00
parent 26ff84d70f
commit 1e9874a482
8 changed files with 34 additions and 35 deletions

View File

@@ -3,7 +3,6 @@ package db
import (
"database/sql"
"fmt"
"os"
// sqlite3 driver.
_ "github.com/mattn/go-sqlite3"
@@ -17,11 +16,3 @@ func Open(dbFile string) (*sql.DB, error) {
}
return db, nil
}
// GetDBFile returns the database file path, checking DATABASE_FILE env var first
func GetDBFile() string {
if f := os.Getenv("DATABASE_FILE"); f != "" {
return f
}
return "mal.db"
}