Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
docs(mysql): Document parseTimet=true requirement
  • Loading branch information
kyleconroy committed Sep 6, 2023
commit 10ab856de6b614a73bdb1a8f3217b569d39b7356
7 changes: 6 additions & 1 deletion docs/tutorials/getting-started-mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ import (
func run() error {
ctx := context.Background()

db, err := sql.Open("mysql", "user:password@/dbname")
db, err := sql.Open("mysql", "user:password@/dbname?parseTime=true")
if err != nil {
return err
}
Expand Down Expand Up @@ -155,3 +155,8 @@ go build ./...

To make that possible, sqlc generates readable, **idiomatic** Go code that you
otherwise would have had to write yourself. Take a look in `tutorial/query.sql.go`.

If your tables have columns with date or time types, sqlc expects these values
to scan into `time.Time` structs. If you're using
`github.com/go-sql-driver/mysql`, ensure that `parseTime=true` has been added to
the connection string.