From 25c7d6d4fb48b69239eba131232a78e90a576e2f Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 30 Apr 2023 02:15:57 -0400 Subject: [PATCH] fix: use database.path over database.name --- db/db.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/db.go b/db/db.go index 887a0f1..f383694 100644 --- a/db/db.go +++ b/db/db.go @@ -27,6 +27,7 @@ func Init() { dbUser := viper.GetString("database.user") dbPassword := viper.GetString("database.password") dbName := viper.GetString("database.name") + dbPath := viper.GetString("database.path") var err error var dsn string @@ -41,7 +42,7 @@ func Init() { db, err = gorm.Open(mysql.Open(dsn), &gorm.Config{}) // Connect to a SQLite database. case "sqlite": - db, err = gorm.Open(sqlite.Open(dbName), &gorm.Config{}) + db, err = gorm.Open(sqlite.Open(dbPath), &gorm.Config{}) // If the database type is unsupported, panic. default: panic(fmt.Errorf("Unsupported database type: %s \n", dbType))