Bring back /databases endpoint

This commit is contained in:
Dan Sosedoff
2014-10-15 16:05:23 -05:00
parent 14f4949efd
commit 5886f153f4
3 changed files with 29 additions and 0 deletions

11
api.go
View File

@@ -34,6 +34,17 @@ func API_Home(c *gin.Context) {
c.Data(200, "text/html; charset=utf-8", data)
}
func API_GetDatabases(c *gin.Context) {
names, err := dbClient.Databases()
if err != nil {
c.JSON(400, NewError(err))
return
}
c.JSON(200, names)
}
func API_RunQuery(c *gin.Context) {
query := strings.TrimSpace(c.Request.FormValue("query"))