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: README.md
+12-6
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@ A MySQL-Driver for Go's [database/sql](https://golang.org/pkg/database/sql/) pac
15
15
*[Address](#address)
16
16
*[Parameters](#parameters)
17
17
*[Examples](#examples)
18
+
*[Connection pool and timeouts](#connection-pool-and-timeouts)
18
19
*[LOAD DATA LOCAL INFILE support](#load-data-local-infile-support)
19
20
*[time.Time support](#timetime-support)
20
21
*[Unicode support](#unicode-support)
@@ -260,11 +261,11 @@ Default: false
260
261
##### `readTimeout`
261
262
262
263
```
263
-
Type: decimal number
264
+
Type: duration
264
265
Default: 0
265
266
```
266
267
267
-
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"*.
268
+
I/O read timeout. The value must be a decimal number with a unit suffix (*"ms"*, *"s"*, *"m"*, *"h"*), such as *"30s"*, *"0.5m"* or *"1m30s"*.
268
269
269
270
##### `strict`
270
271
@@ -283,11 +284,11 @@ By default MySQL also treats notes as warnings. Use [`sql_notes=false`](http://d
283
284
##### `timeout`
284
285
285
286
```
286
-
Type: decimal number
287
+
Type: duration
287
288
Default: OS default
288
289
```
289
290
290
-
*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).
291
+
Timeout for establishing connections, aka dial timeout. The value must be a decimal number with a unit suffix (*"ms"*, *"s"*, *"m"*, *"h"*), such as *"30s"*, *"0.5m"* or *"1m30s"*.
291
292
292
293
##### `tls`
293
294
@@ -302,11 +303,11 @@ Default: false
302
303
##### `writeTimeout`
303
304
304
305
```
305
-
Type: decimal number
306
+
Type: duration
306
307
Default: 0
307
308
```
308
309
309
-
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"*.
310
+
I/O write timeout. The value must be a decimal number with a unit suffix (*"ms"*, *"s"*, *"m"*, *"h"*), such as *"30s"*, *"0.5m"* or *"1m30s"*.
310
311
311
312
312
313
##### System Variables
@@ -380,6 +381,11 @@ No Database preselected:
380
381
user:password@/
381
382
```
382
383
384
+
385
+
### Connection pool and timeouts
386
+
The connection pool is managed by Go's database/sql package. For details on how to configure the size of the pool and how long connections stay in the pool see `*DB.SetMaxOpenConns`, `*DB.SetMaxIdleConns`, and `*DB.SetConnMaxLifetime` in the [database/sql documentation](https://golang.org/pkg/database/sql/). The read, write, and dial timeouts for each individual connection are configured with the DSN parameters [`readTimeout`](#readtimeout), [`writeTimeout`](#writetimeout), and [`timeout`](#timeout), respectively.
387
+
388
+
383
389
### `LOAD DATA LOCAL INFILE` support
384
390
For this feature you need direct access to the package. Therefore you must change the import path (no `_`):
0 commit comments