Skip to content

Commit

Permalink
remove confusion caused by unnecessary logic ported from old mysql setup
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed May 6, 2023
1 parent 52f33fe commit b7817c7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions server/db/postgres/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ type configType struct {
Port string `json:"port,omitempty"`
DBName string `json:"dbname,omitempty"`
// Deprecated.
DSN string `json:"dsn,omitempty"`
Database string `json:"database,omitempty"`
DSN string `json:"dsn,omitempty"`

// Connection pool settings.
//
Expand Down Expand Up @@ -119,16 +118,15 @@ func (a *adapter) Open(jsonconfig json.RawMessage) error {

if config.DSN != "" {
a.dsn = config.DSN
a.dbName = config.Database
} else {
dsn, err := setConnStr(config)
a.dsn, err = setConnStr(config)
if err != nil {
return err
}
a.dsn = dsn
a.dbName = config.DBName
}

a.dbName = config.DBName

if a.dsn == "" {
a.dsn = defaultDSN
}
Expand Down

0 comments on commit b7817c7

Please sign in to comment.