summaryrefslogtreecommitdiff
path: root/internal/db
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db')
-rw-r--r--internal/db/bundb/bundb.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/db/bundb/bundb.go b/internal/db/bundb/bundb.go
index d10f372fd..8756e086b 100644
--- a/internal/db/bundb/bundb.go
+++ b/internal/db/bundb/bundb.go
@@ -420,13 +420,12 @@ func maxOpenConns() int {
// deriveBunDBPGOptions takes an application config and returns either a ready-to-use set of options
// with sensible defaults, or an error if it's not satisfied by the provided config.
func deriveBunDBPGOptions() (*pgx.ConnConfig, error) {
- url := config.GetDbPostgresConnectionString()
-
- // if database URL is defined, ignore other DB related configuration fields
- if url != "" {
- cfg, err := pgx.ParseConfig(url)
- return cfg, err
+ // If database URL is defined, ignore
+ // other DB-related configuration fields.
+ if url := config.GetDbPostgresConnectionString(); url != "" {
+ return pgx.ParseConfig(url)
}
+
// these are all optional, the db adapter figures out defaults
address := config.GetDbAddress()