Skip to content

Commit

Permalink
feat: allow application name to be passed in postgres connection url (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
iand authored Nov 18, 2020
1 parent b1f6676 commit 042d470
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion storage/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 042d470

Please sign in to comment.