Move info query into client
This commit is contained in:
parent
42f79a7079
commit
814c33938c
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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user