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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
-17
Original file line number
Diff line number
Diff line change
@@ -4,28 +4,11 @@
4
4
5
5
Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed).
6
6
7
-
Please provide the following minimum information:
8
-
* Your Go-MySQL-Driver version (or git SHA)
9
-
* Your Go version (run `go version` in your console)
10
-
* A detailed issue description
11
-
* Error Log if present
12
-
* If possible, a short example
13
-
14
-
15
7
## Contributing Code
16
8
17
9
By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file.
18
10
Don't forget to add yourself to the AUTHORS file.
19
11
20
-
### Pull Requests Checklist
21
-
22
-
Please check the following points before submitting your pull request:
23
-
-[x] Code compiles correctly
24
-
-[x] Created tests, if possible
25
-
-[x] All tests pass
26
-
-[x] Extended the README / documentation, if necessary
27
-
-[x] Added yourself to the AUTHORS file
28
-
29
12
### Code Review
30
13
31
14
Everyone is invited to review and comment on pull requests.
Copy file name to clipboardExpand all lines: README.md
+36-2
Original file line number
Diff line number
Diff line change
@@ -93,6 +93,8 @@ This has the same effect as an empty DSN string:
93
93
94
94
```
95
95
96
+
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.
97
+
96
98
#### Password
97
99
Passwords can consist of any character. Escaping is **not** necessary.
98
100
@@ -219,6 +221,18 @@ Note that this sets the location for time.Time values but does not change MySQL'
219
221
220
222
Please keep in mind, that param values must be [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape)'ed. Alternatively you can manually replace the `/` with `%2F`. For example `US/Pacific` would be `loc=US%2FPacific`.
221
223
224
+
##### `multiStatements`
225
+
226
+
```
227
+
Type: bool
228
+
Valid Values: true, false
229
+
Default: false
230
+
```
231
+
232
+
Allow multiple statements in one query. While this allows batch queries, it also greatly increases the risk of SQL injections. Only the result of the first query is returned, all other results are silently discarded.
233
+
234
+
When `multiStatements` is used, `?` parameters must only be used in the first statement.
235
+
222
236
223
237
##### `parseTime`
224
238
@@ -231,6 +245,16 @@ Default: false
231
245
`parseTime=true` changes the output type of `DATE` and `DATETIME` values to `time.Time` instead of `[]byte` / `string`
232
246
233
247
248
+
##### `readTimeout`
249
+
250
+
```
251
+
Type: decimal number
252
+
Default: 0
253
+
```
254
+
255
+
I/O read timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*.
256
+
257
+
234
258
##### `strict`
235
259
236
260
```
@@ -251,7 +275,7 @@ Type: decimal number
251
275
Default: OS default
252
276
```
253
277
254
-
*Driver* side connection timeout. The value must be a string of decimal numbers, each with optional fraction and a unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. To set a server side timeout, use the parameter [`wait_timeout`](http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout).
278
+
*Driver* side connection timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. To set a server side timeout, use the parameter [`wait_timeout`](http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout).
255
279
256
280
257
281
##### `tls`
@@ -265,6 +289,16 @@ Default: false
265
289
`tls=true` enables TLS / SSL encrypted connection to the server. Use `skip-verify` if you want to use a self-signed or invalid certificate (server side). Use a custom value registered with [`mysql.RegisterTLSConfig`](http://godoc.org/github.com/go-sql-driver/mysql#RegisterTLSConfig).
266
290
267
291
292
+
##### `writeTimeout`
293
+
294
+
```
295
+
Type: decimal number
296
+
Default: 0
297
+
```
298
+
299
+
I/O write timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*.
300
+
301
+
268
302
##### System Variables
269
303
270
304
All other parameters are interpreted as system variables:
Files must be whitelisted by registering them with `mysql.RegisterLocalFile(filepath)` (recommended) or the Whitelist check must be deactivated by using the DSN parameter `allowAllFiles=true` ([*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)).
333
367
334
-
To use a `io.Reader` a handler function must be registered with `mysql.RegisterReaderHandler(name, handler)` which returns a `io.Reader` or `io.ReadCloser`. The Reader is available with the filepath `Reader::<name>` then.
368
+
To use a `io.Reader` a handler function must be registered with `mysql.RegisterReaderHandler(name, handler)` which returns a `io.Reader` or `io.ReadCloser`. The Reader is available with the filepath `Reader::<name>` then. Choose different names for different handlers and `DeregisterReaderHandler` when you don't need it anymore.
335
369
336
370
See the [godoc of Go-MySQL-Driver](http://godoc.org/github.com/go-sql-driver/mysql"golang mysql driver documentation") for details.
0 commit comments