Skip to content

Commit 2c7ed6f

Browse files
committed
doc: add link to NewConnector from FormatDSN
Advise to use NewConnector instead of FormatDSN because roundtripping is known to not work well. See #1410 (comment)
1 parent 397e2f5 commit 2c7ed6f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dsn.go

+2
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ func writeDSNParam(buf *bytes.Buffer, hasParam *bool, name, value string) {
177177

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

0 commit comments

Comments
 (0)