From 2bc16d6c1bd2a4aae06c36898813e92291b6ec1c Mon Sep 17 00:00:00 2001 From: Dan Sosedoff Date: Fri, 12 Dec 2014 18:21:40 -0600 Subject: [PATCH] Print connection string when creating a new client with debug option --- client.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client.go b/client.go index 5a8e321..d4d2036 100644 --- a/client.go +++ b/client.go @@ -24,6 +24,11 @@ type Result struct { func NewClient() (*Client, error) { str := getConnectionString() + + if options.Debug { + fmt.Println("Creating a new client with: %s", str) + } + db, err := sqlx.Open("postgres", str) if err != nil { @@ -34,6 +39,10 @@ func NewClient() (*Client, error) { } func NewClientFromUrl(url string) (*Client, error) { + if options.Debug { + fmt.Println("Creating a new client with: %s", url) + } + db, err := sqlx.Open("postgres", url) if err != nil {