Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion utils/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,8 @@ func TransSQLAchemyURL(pySQLSrc string) (dialect, ret string, err error) {
} else {
query = url.Values{}
}
query.Set("parseTime", "True")
query.Set("parseTime", "true")
query.Set("interpolateParams", "true")
ret = fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?%s", user, passwd, host, port, dburl, query.Encode())
return
}
Expand Down
4 changes: 2 additions & 2 deletions utils/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ func TestTransSQLAchemyURL(t *testing.T) {
{
name: "should convert",
args: args{"mysql+pymysql://root:root@127.0.0.1:3306/mclouds?charset=utf8"},
wantRet: "root:root@tcp(127.0.0.1:3306)/mclouds?charset=utf8&parseTime=True",
wantRet: "root:root@tcp(127.0.0.1:3306)/mclouds?charset=utf8&interpolateParams=true&parseTime=true",
wantErr: false,
},
{
Expand All @@ -672,7 +672,7 @@ func TestTransSQLAchemyURL(t *testing.T) {
}, {
name: "supported at",
args: args{"mysql+pymysql://root:5bTcx^@Peh4nj3H7@127.0.0.1:3306/mclouds?charset=utf8"},
wantRet: "root:5bTcx^@Peh4nj3H7@tcp(127.0.0.1:3306)/mclouds?charset=utf8&parseTime=True",
wantRet: "root:5bTcx^@Peh4nj3H7@tcp(127.0.0.1:3306)/mclouds?charset=utf8&interpolateParams=true&parseTime=true",
wantErr: false,
},
}
Expand Down