Print connection string when creating a new client with debug option

This commit is contained in:
Dan Sosedoff 2014-12-12 18:21:40 -06:00
parent d93ec7e56d
commit 2bc16d6c1b

View File

@ -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 {