diff options
author | Thomas Voss <mail@thomasvoss.com> | 2025-06-09 02:51:27 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2025-06-09 02:51:27 +0200 |
commit | 52db1d03e5067de4ba77c3a12465149d268eb3d1 (patch) | |
tree | 96286b94957e2546a789cbdcad2677b6f03b0973 /main.go | |
parent | 09defec0a015e7ddb118bd453ea2925a5cb9d5dc (diff) |
Begin migration towards SQLite
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -11,6 +11,7 @@ import ( "time" "git.thomasvoss.com/euro-cash.eu/src" + "git.thomasvoss.com/euro-cash.eu/src/dbx" "git.thomasvoss.com/euro-cash.eu/src/email" ) @@ -29,11 +30,14 @@ func main() { "address to send error messages from") flag.StringVar(&email.Config.Password, "email-password", "", "password to authenticate the email client") + flag.StringVar(&dbx.DBName, "db-name", "eurocash.db", + "database name or ‘:memory:’ for an in-memory database") flag.Parse() if *debugp { go watch() } + dbx.Init() src.Run(*port) } @@ -55,6 +59,7 @@ func watch() { } if nstat.ModTime() != ostat.ModTime() { + dbx.DB.Close() if err := syscall.Exec(path, os.Args, os.Environ()); err != nil { log.Fatal(err) } |