add encrypt connstr param conditionally on the value chosen via GUI.

This commit is contained in:
Ramiro Morales
2018-10-16 13:14:22 -03:00
parent cf6faabd12
commit 49a3bd3097
+5 -2
View File
@@ -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 {