Use simple connection string in config
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user