This commit is contained in:
@@ -90,7 +90,7 @@ func (m *Config) checkDefault() {
|
||||
}
|
||||
|
||||
if m.TimeZone == "" {
|
||||
m.TimeZone = "Asia/Shanghai"
|
||||
// m.TimeZone = "Asia/Shanghai"
|
||||
}
|
||||
|
||||
if m.Port == 0 {
|
||||
@@ -104,9 +104,13 @@ func (m *Config) checkDefault() {
|
||||
|
||||
func (m *Config) EmptyDsn() string {
|
||||
// 基本 DSN
|
||||
dsnTpl := "host=%s user=%s password=%s port=%d dbname=%s sslmode=%s TimeZone=%s"
|
||||
// dsnTpl := "host=%s user=%s password=%s port=%d dbname=%s sslmode=%s TimeZone=%s"
|
||||
// m.checkDefault()
|
||||
// base := fmt.Sprintf(dsnTpl, m.Host, m.Username, m.Password, m.Port, m.Database, m.SslMode, m.TimeZone)
|
||||
|
||||
dsnTpl := "host=%s user=%s password=%s port=%d dbname=%s sslmode=%s"
|
||||
m.checkDefault()
|
||||
base := fmt.Sprintf(dsnTpl, m.Host, m.Username, m.Password, m.Port, m.Database, m.SslMode, m.TimeZone)
|
||||
base := fmt.Sprintf(dsnTpl, m.Host, m.Username, m.Password, m.Port, m.Database, m.SslMode)
|
||||
// 附加可选参数
|
||||
extras := ""
|
||||
if m.UseSearchPath && m.Schema != "" {
|
||||
@@ -121,9 +125,9 @@ func (m *Config) EmptyDsn() string {
|
||||
// DSN connection dsn
|
||||
func (m *Config) DSN() string {
|
||||
// 基本 DSN
|
||||
dsnTpl := "host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s"
|
||||
dsnTpl := "host=%s user=%s password=%s dbname=%s port=%d sslmode=%s"
|
||||
m.checkDefault()
|
||||
base := fmt.Sprintf(dsnTpl, m.Host, m.Username, m.Password, m.Database, m.Port, m.SslMode, m.TimeZone)
|
||||
base := fmt.Sprintf(dsnTpl, m.Host, m.Username, m.Password, m.Database, m.Port, m.SslMode)
|
||||
// 附加可选参数
|
||||
extras := ""
|
||||
if m.UseSearchPath && m.Schema != "" {
|
||||
|
||||
Reference in New Issue
Block a user