Fix connection string printing format in debug mode
This commit is contained in:
@@ -32,8 +32,8 @@ type RowsOptions struct {
|
|||||||
func NewClient() (*Client, error) {
|
func NewClient() (*Client, error) {
|
||||||
str, err := buildConnectionString(options)
|
str, err := buildConnectionString(options)
|
||||||
|
|
||||||
if options.Debug {
|
if options.Debug && str != "" {
|
||||||
fmt.Println("Creating a new client with:", str)
|
fmt.Println("Creating a new client for:", str)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -57,7 +57,7 @@ func NewClient() (*Client, error) {
|
|||||||
|
|
||||||
func NewClientFromUrl(url string) (*Client, error) {
|
func NewClientFromUrl(url string) (*Client, error) {
|
||||||
if options.Debug {
|
if options.Debug {
|
||||||
fmt.Println("Creating a new client with: %s", url)
|
fmt.Println("Creating a new client for:", url)
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := sqlx.Open("postgres", url)
|
db, err := sqlx.Open("postgres", url)
|
||||||
|
|||||||
Reference in New Issue
Block a user