Skip to content
Snippets Groups Projects
Commit 0d9d89fb authored by Niall Sheridan's avatar Niall Sheridan
Browse files

use mysql.NewConfig() to set defaults correctly

parent de6d2c52
Branches
Tags
No related merge requests found
...@@ -38,14 +38,12 @@ func NewSQLStore(c config.Database) (*SQLStore, error) { ...@@ -38,14 +38,12 @@ func NewSQLStore(c config.Database) (*SQLStore, error) {
if err != nil { if err != nil {
address = address + ":3306" address = address + ":3306"
} }
m := &mysql.Config{ m := mysql.NewConfig()
User: c["username"], m.User = c["username"]
Passwd: c["password"], m.Passwd = c["password"]
Net: "tcp", m.Addr = address
Addr: address, m.DBName = "certs"
DBName: "certs", m.ParseTime = true
ParseTime: true,
}
dsn = m.FormatDSN() dsn = m.FormatDSN()
case "sqlite": case "sqlite":
driver = "sqlite3" driver = "sqlite3"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment