add encrypt connstr param conditionally on the value chosen via GUI.
This commit is contained in:
@@ -53,14 +53,17 @@ func generateConnectionString(datasource *models.DataSource) string {
|
||||
|
||||
server, port := hostParts[0], hostParts[1]
|
||||
encrypt := datasource.JsonData.Get("encrypt").MustString("false")
|
||||
return fmt.Sprintf("server=%s;port=%s;database=%s;user id=%s;password=%s;encrypt=%s;",
|
||||
connStr := fmt.Sprintf("server=%s;port=%s;database=%s;user id=%s;password=%s;",
|
||||
server,
|
||||
port,
|
||||
datasource.Database,
|
||||
datasource.User,
|
||||
password,
|
||||
encrypt,
|
||||
)
|
||||
if encrypt != "false" {
|
||||
connStr += fmt.Sprintf("encrypt=%s;", encrypt)
|
||||
}
|
||||
return connStr
|
||||
}
|
||||
|
||||
type mssqlRowTransformer struct {
|
||||
|
||||
Reference in New Issue
Block a user