You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support for slashes in database names via url escape codes.
On the other hand, '%' in DSN is now treated as percent-encoding.
Co-authored-by: Brian Hendriks <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+6
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,12 @@ This has the same effect as an empty DSN string:
114
114
115
115
```
116
116
117
+
`dbname` is escaped by [PathEscape()]()https://pkg.go.dev/net/url#PathEscape) since v1.8.0. If your database name is `dbname/withslash`, it becomes:
118
+
119
+
```
120
+
/dbname%2Fwithslash
121
+
```
122
+
117
123
Alternatively, [Config.FormatDSN](https://godoc.org/github.com/go-sql-driver/mysql#Config.FormatDSN) can be used to create a DSN string by filling a struct.
0 commit comments