Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dsn.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,13 @@ func (cfg *Config) FormatDSN() string {
return buf.String()
}

// ParseDSN parses the DSN string to a Config
// ParseDSN parses the DSN string to a Config.
//
// The DSN format is [user[:password]@][net[(addr)]]/dbname[?params].
// Because the colon is used as the user/password separator, usernames that
// contain a colon cannot be represented unambiguously in the DSN string format.
// If your username contains a colon, use [NewConfig] and set the fields directly
// instead of constructing a DSN string.
func ParseDSN(dsn string) (cfg *Config, err error) {
// New config with some default values
cfg = NewConfig()
Expand Down
Loading