Skip to content

Commit

Permalink
Merge pull request #121 from kylin2017/master
Browse files Browse the repository at this point in the history
MOD
  • Loading branch information
kylin2017 authored Nov 14, 2019
2 parents cb83d50 + 27116a7 commit 746ea75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dbrouter/gorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func dialByGorm(info *Sql) (db *gorm.DB, err error) {

var dataSourceName string
if info.dbType == DB_TYPE_MYSQL {
dataSourceName = fmt.Sprintf("%s:%s@tcp(%s)/%s", info.userName, info.passWord, info.dbAddr, info.dbName)
dataSourceName = fmt.Sprintf("%s:%s@tcp(%s)/%s?parseTime=True&loc=Local", info.userName, info.passWord, info.dbAddr, info.dbName)

} else if info.dbType == DB_TYPE_POSTGRES {
dataSourceName = fmt.Sprintf("postgres://%s:%s@%s/%s?sslmode=disable",
Expand Down
2 changes: 1 addition & 1 deletion dbrouter/sqlx.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func dialBySqlx(info *Sql) (db *sqlx.DB, err error) {

var dataSourceName string
if info.dbType == DB_TYPE_MYSQL {
dataSourceName = fmt.Sprintf("%s:%s@tcp(%s)/%s?parseTime=True&loc=Local", info.userName, info.passWord, info.dbAddr, info.dbName)
dataSourceName = fmt.Sprintf("%s:%s@tcp(%s)/%s", info.userName, info.passWord, info.dbAddr, info.dbName)

} else if info.dbType == DB_TYPE_POSTGRES {
dataSourceName = fmt.Sprintf("postgres://%s:%s@%s/%s?sslmode=disable",
Expand Down

0 comments on commit 746ea75

Please sign in to comment.