From 2c7ed6f3af9273b26b4a179390b3f114102dc123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Mengu=C3=A9?= Date: Thu, 1 Jun 2023 22:39:44 +0200 Subject: [PATCH] doc: add link to NewConnector from FormatDSN Advise to use NewConnector instead of FormatDSN because roundtripping is known to not work well. See https://github.com/go-sql-driver/mysql/issues/1410#issuecomment-1510866931 --- dsn.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dsn.go b/dsn.go index 693aa4e5a..380ca9570 100644 --- a/dsn.go +++ b/dsn.go @@ -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