Skip to content

Commit

Permalink
no database connection if no host given
Browse files Browse the repository at this point in the history
  • Loading branch information
bboehmke committed Apr 21, 2024
1 parent a39ab2f commit b4387f0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ type PostgresConnection struct {

// NewPostgresConnection from the given configuration
func NewPostgresConnection(config DatabaseConfig) *PostgresConnection {
// no database connection if no host given
if config.Host == "" {
return nil
}

conf := PostgresConnection{
Config: config,
}
Expand Down

0 comments on commit b4387f0

Please sign in to comment.