Append ssl mode to url if ssl flag is set and not defined in the url
This commit is contained in:
parent
e032315195
commit
61ecc9e9a1
9
main.go
9
main.go
@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const VERSION = "0.3.1"
|
const VERSION = "0.3.1"
|
||||||
@ -38,7 +39,13 @@ func exitWithMessage(message string) {
|
|||||||
|
|
||||||
func getConnectionString() string {
|
func getConnectionString() string {
|
||||||
if options.Url != "" {
|
if options.Url != "" {
|
||||||
return options.Url
|
url := options.Url
|
||||||
|
|
||||||
|
if options.Ssl != "" && !strings.Contains(url, "sslmode") {
|
||||||
|
url += fmt.Sprintf("?sslmode=%s", options.Ssl)
|
||||||
|
}
|
||||||
|
|
||||||
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
str := fmt.Sprintf(
|
str := fmt.Sprintf(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user