Move info query into client
This commit is contained in:
2
api.go
2
api.go
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user