From 042d470068a854335c599534d979f3782f37b711 Mon Sep 17 00:00:00 2001 From: Ian Davis Date: Wed, 18 Nov 2020 20:02:48 +0000 Subject: [PATCH] feat: allow application name to be passed in postgres connection url (#243) --- storage/sql.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/sql.go b/storage/sql.go index 93d475fc5..9bc5baf68 100644 --- a/storage/sql.go +++ b/storage/sql.go @@ -93,7 +93,9 @@ func NewDatabase(ctx context.Context, url string, poolSize int) (*Database, erro return nil, xerrors.Errorf("parse database URL: %w", err) } opt.PoolSize = poolSize - opt.ApplicationName = "visor-" + version.String() + if opt.ApplicationName == "" { + opt.ApplicationName = "visor-" + version.String() + } return &Database{ opt: opt,