Skip to content

Commit b387955

Browse files
committed
[bugfix] parse dsn
1 parent 5ba5233 commit b387955

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/database/sql/sql.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ func (c *Config) parseDSNAddr(dsn string) (addr string) {
101101
}
102102
addr = cfgKVs["host"] + ":" + cfgKVs["port"]
103103
default:
104-
if c.dsnFn == nil {
105-
addr = dsn
104+
addr = dsn
105+
if c.dsnFn != nil {
106+
addr = c.dsnFn(dsn)
106107
}
107-
addr = c.dsnFn(dsn)
108108
}
109109
return
110110
}

0 commit comments

Comments
 (0)