From 5be7927799ff34a9a764ff6f6d3ff01076d7255c Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sun, 31 Mar 2024 22:18:28 +0200 Subject: [PATCH] fix dsn when when th database is postgresql --- config/database_config.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/database_config.go b/config/database_config.go index 6cd37f2..bcc62f6 100644 --- a/config/database_config.go +++ b/config/database_config.go @@ -30,7 +30,12 @@ func LoadDatabaseConfig(dsn string) (DatabaseConfig, error) { dbType := elements[0] - config.Dsn = strings.Replace(dsn, fmt.Sprintf("%s://", dbType), "", 1) + if dbType == "postgres" { + config.Dsn = dsn + } else { + config.Dsn = strings.Replace(dsn, fmt.Sprintf("%s://", dbType), "", 1) + } + config.Type = elements[0] return config, nil