send credentials if provided

pull/1881/head
Cory LaNou 2015-03-07 07:27:35 -07:00
parent 71ec2bbf2b
commit 278c652d6f
1 changed files with 3 additions and 0 deletions

View File

@ -47,6 +47,9 @@ func (c *Client) Query(q Query) (*Results, error) {
u := c.url
u.Path = "query"
if c.username != "" {
u.User = url.UserPassword(c.username, c.password)
}
values := u.Query()
values.Set("q", q.Command)
values.Set("db", q.Database)