From 52db1d03e5067de4ba77c3a12465149d268eb3d1 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 9 Jun 2025 02:51:27 +0200 Subject: Begin migration towards SQLite --- main.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 93d9017..299d77c 100644 --- a/main.go +++ b/main.go @@ -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) } -- cgit v1.2.3