Skip to content

Commit e330067

Browse files
[Docs] clarify connection close behavior of context
Updates the README to make it clear that `go-sql-driver/mysql` closes the current connection of the `context.Context` provided to `ExecContext`, `SelectContext`, etc. is cancelled or times out prior to the query returning. As is, that behavior is not clearly documented.
1 parent 3484db1 commit e330067

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ This driver supports the [`ColumnType` interface](https://golang.org/pkg/databas
519519
Go 1.8 added `database/sql` support for `context.Context`. This driver supports query timeouts and cancellation via contexts.
520520
See [context support in the database/sql package](https://golang.org/doc/go1.8#database_sql) for more details.
521521

522+
Importantly, the `SelectContext`, `ExecContext`, etc. variants provided by `database/sql` will cause the connection to be closed if the provided context is cancelled or timed out before the result is received by the driver.
523+
522524

523525
### `LOAD DATA LOCAL INFILE` support
524526
For this feature you need direct access to the package. Therefore you must change the import path (no `_`):

0 commit comments

Comments
 (0)