mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 15:18:01 +08:00
MySQL Datasource: Add timezone parameter (#27535)
* Add MySQL timezone parameter * Reword docs/sources/features/datasources/mysql.md Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com> * update documentation * fix formatting mistake from merge * enhance documentation with reason for parameter usage * enhance documentation with reason for parameter usage Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
@ -64,6 +64,13 @@ func New(httpClientProvider httpclient.Provider) func(datasource *models.DataSou
|
||||
cnnstr += "&tls=" + tlsConfigString
|
||||
}
|
||||
|
||||
if datasource.JsonData != nil {
|
||||
timezone, hasTimezone := datasource.JsonData.CheckGet("timezone")
|
||||
if hasTimezone && timezone.MustString() != "" {
|
||||
cnnstr += fmt.Sprintf("&time_zone='%s'", url.QueryEscape(timezone.MustString()))
|
||||
}
|
||||
}
|
||||
|
||||
if setting.Env == setting.Dev {
|
||||
logger.Debug("getEngine", "connection", cnnstr)
|
||||
}
|
||||
|
Reference in New Issue
Block a user