Explain analyze dropdown button (#532)
* Adds bootstrap dropdown plugin * Float dropdown toggle left * Extract query running message toggles * Adds analyze function and api call * Adds analyze api
This commit is contained in:
@@ -280,7 +280,7 @@ func RunQuery(c *gin.Context) {
|
||||
HandleQuery(query, c)
|
||||
}
|
||||
|
||||
// ExplainQuery renders query analyze profile
|
||||
// ExplainQuery renders query explain plan
|
||||
func ExplainQuery(c *gin.Context) {
|
||||
query := cleanQuery(c.Request.FormValue("query"))
|
||||
|
||||
@@ -289,6 +289,18 @@ func ExplainQuery(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
HandleQuery(fmt.Sprintf("EXPLAIN %s", query), c)
|
||||
}
|
||||
|
||||
// AnalyzeQuery renders query explain plan and analyze profile
|
||||
func AnalyzeQuery(c *gin.Context) {
|
||||
query := cleanQuery(c.Request.FormValue("query"))
|
||||
|
||||
if query == "" {
|
||||
badRequest(c, errQueryRequired)
|
||||
return
|
||||
}
|
||||
|
||||
HandleQuery(fmt.Sprintf("EXPLAIN ANALYZE %s", query), c)
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ func SetupRoutes(router *gin.Engine) {
|
||||
api.POST("/query", RunQuery)
|
||||
api.GET("/explain", ExplainQuery)
|
||||
api.POST("/explain", ExplainQuery)
|
||||
api.GET("/analyze", AnalyzeQuery)
|
||||
api.POST("/analyze", AnalyzeQuery)
|
||||
api.GET("/history", GetHistory)
|
||||
api.GET("/bookmarks", GetBookmarks)
|
||||
api.GET("/export", DataExport)
|
||||
|
||||
Reference in New Issue
Block a user