Move info query into client

This commit is contained in:
Chris Bandy 2014-10-16 02:59:43 +00:00
parent 42f79a7079
commit 814c33938c
2 changed files with 5 additions and 1 deletions

2
api.go
View File

@ -94,7 +94,7 @@ func API_History(c *gin.Context) {
}
func API_Info(c *gin.Context) {
res, err := dbClient.Query(PG_INFO)
res, err := dbClient.Info()
if err != nil {
c.JSON(400, NewError(err))

View File

@ -48,6 +48,10 @@ func (client *Client) recordQuery(query string) {
client.history = append(client.history, query)
}
func (client *Client) Info() (*Result, error) {
return client.Query(PG_INFO)
}
func (client *Client) Databases() ([]string, error) {
res, err := client.Query(PG_DATABASES)