Add context menu to display database tables stats (#639)
* Add context menu to display database tables stats * Move table stats implementation into client
This commit is contained in:
@@ -497,6 +497,12 @@ func GetTableConstraints(c *gin.Context) {
|
||||
serveResult(c, res, err)
|
||||
}
|
||||
|
||||
// GetTablesStats renders data sizes and estimated rows for all tables in the database
|
||||
func GetTablesStats(c *gin.Context) {
|
||||
res, err := DB(c).TablesStats()
|
||||
serveResult(c, res, err)
|
||||
}
|
||||
|
||||
// HandleQuery runs the database query
|
||||
func HandleQuery(query string, c *gin.Context) {
|
||||
metrics.IncrementQueriesCount()
|
||||
|
||||
@@ -43,6 +43,7 @@ func SetupRoutes(router *gin.Engine) {
|
||||
api.GET("/tables/:table/info", GetTableInfo)
|
||||
api.GET("/tables/:table/indexes", GetTableIndexes)
|
||||
api.GET("/tables/:table/constraints", GetTableConstraints)
|
||||
api.GET("/tables_stats", GetTablesStats)
|
||||
api.GET("/functions/:id", GetFunction)
|
||||
api.GET("/query", RunQuery)
|
||||
api.POST("/query", RunQuery)
|
||||
|
||||
Reference in New Issue
Block a user