We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 00a78a7 commit a978797Copy full SHA for a978797
1 file changed
internal/dbConnection.go
@@ -5,9 +5,9 @@ import (
5
"embed"
6
_ "embed"
7
"fmt"
8
- "log"
9
"net/http"
10
+ "github.com/charmbracelet/log"
11
"github.com/golang-migrate/migrate/v4"
12
"github.com/golang-migrate/migrate/v4/database/sqlite"
13
"github.com/golang-migrate/migrate/v4/source/httpfs"
@@ -24,7 +24,13 @@ type DbConnection struct {
24
25
func NewConnection(migrationsFs embed.FS) DbConnection {
26
27
- conn, err := sql.Open("sqlite3", dbFileName)
+ configDbFile := GetSetting("DB_FILE")
28
+ if configDbFile == "" {
29
+ configDbFile = dbFileName
30
+ }
31
+ log.Info("DB using file : " + configDbFile)
32
+
33
+ conn, err := sql.Open("sqlite3", configDbFile)
34
if err != nil {
35
log.Fatal(err)
36
}
0 commit comments