Show table constraints
This commit is contained in:
@@ -179,6 +179,11 @@ func GetTableIndexes(c *gin.Context) {
|
||||
serveResult(res, err, c)
|
||||
}
|
||||
|
||||
func GetTableConstraints(c *gin.Context) {
|
||||
res, err := DbClient.TableConstraints(c.Params.ByName("table"))
|
||||
serveResult(res, err, c)
|
||||
}
|
||||
|
||||
func HandleQuery(query string, c *gin.Context) {
|
||||
rawQuery, err := base64.StdEncoding.DecodeString(query)
|
||||
if err == nil {
|
||||
|
||||
@@ -33,6 +33,7 @@ func SetupRoutes(router *gin.Engine) {
|
||||
api.GET("/tables/:table/rows", GetTableRows)
|
||||
api.GET("/tables/:table/info", GetTableInfo)
|
||||
api.GET("/tables/:table/indexes", GetTableIndexes)
|
||||
api.GET("/tables/:table/constraints", GetTableConstraints)
|
||||
api.GET("/query", RunQuery)
|
||||
api.POST("/query", RunQuery)
|
||||
api.GET("/explain", ExplainQuery)
|
||||
|
||||
Reference in New Issue
Block a user