Skip to content

Commit 6e8d4cd

Browse files
committed
Update README.md
1 parent 716467d commit 6e8d4cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ A MySQL-Driver for Go's [database/sql](http://golang.org/pkg/database/sql) packa
3333
* Automatic handling of broken connections
3434
* Automatic Connection Pooling *(by database/sql package)*
3535
* Supports queries larger than 16MB
36+
* Full [`sql.RawBytes`](http://golang.org/pkg/database/sql/#RawBytes) support.
3637
* Intelligent `LONG DATA` handling in prepared statements
3738
* Secure `LOAD DATA LOCAL INFILE` support with file Whitelisting and `io.Reader` support
39+
* Optional `time.Time` parsing
3840

3941
## Requirements
4042
* Go 1.0.3 or higher
@@ -152,7 +154,7 @@ See also the [godoc of Go-MySQL-Driver](http://godoc.org/github.com/go-sql-drive
152154
### `time.Time` support
153155
The default internal output type of MySQL `DATE` and `DATETIME` values is `[]byte` which allows you to scan the value into a `[]byte`, `string` or `sql.RawBytes` variable in your programm.
154156

155-
However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` variables, which is the logical opposite in Go to `DATE` and `DATETIME` in MySQL. You can do that by changing the internal output type from `[]byte` to `time.Time` with the DSN parameter `parseTime=true`. You can set the default [`time.Time` location](http://golang.org/pkg/time/#Location) with the `loc` DSN parameter.
157+
However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` variables, which is the logical opposite in Go to `DATE` and `DATETIME` in MySQL. You can do that by changing the internal output type from `[]byte` to `time.Time` with the DSN parameter `parseTime=true`. You can set the default [`time.Time` location](http://golang.org/pkg/time/#Location) with the `loc` DSN parameter.
156158
**Caution:** As of Go 1.1, this makes `time.Time` the only variable type you can scan `DATE` and `DATETIME` values into. This breaks for example [`sql.RawBytes` support](https://github.com/go-sql-driver/mysql/wiki/Examples#rawbytes).
157159

158160

0 commit comments

Comments
 (0)