Use simple connection string in config

This commit is contained in:
jacob1123 committed 2022-02-09 22:40:35 +00:00
1 parent 2c71c521f9
commit e934d407c2
3 files changed
+6 -18

No files matched your search

+1 -2
View File
@@ -18,8 +18,7 @@ type Database struct {
}
// Connect to a database
func Connect(server string, user string, password string, database string) (*Database, error) {
connString := fmt.Sprintf("postgres://%s:%s@%s/%s", user, password, server, database)
func Connect(connString string) (*Database, error) {
conn, err := sql.Open("pgx", connString)
if err != nil {
return nil, fmt.Errorf("open connection: %w", err)