Skip to content

Commit

Permalink
doc: add link to NewConnector from FormatDSN (#1442)
Browse files Browse the repository at this point in the history
Advise to use NewConnector instead of FormatDSN because roundtripping is known to not work well.
See #1410 (comment)
  • Loading branch information
dolmen committed Jun 2, 2023
1 parent 397e2f5 commit 8365b94
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dsn.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ func writeDSNParam(buf *bytes.Buffer, hasParam *bool, name, value string) {

// FormatDSN formats the given Config into a DSN string which can be passed to
// the driver.
//
// Note: use [NewConnector] and [database/sql.OpenDB] to open a connection from a [*Config].
func (cfg *Config) FormatDSN() string {
var buf bytes.Buffer

Expand Down

0 comments on commit 8365b94

Please sign in to comment.