Add /tables/:name/info endpoint to get table data details
This commit is contained in:
11
api.go
11
api.go
@@ -89,6 +89,17 @@ func API_GetTable(c *gin.Context) {
|
||||
c.JSON(200, res)
|
||||
}
|
||||
|
||||
func API_GetTableInfo(c *gin.Context) {
|
||||
res, err := dbClient.TableInfo(c.Params.ByName("table"))
|
||||
|
||||
if err != nil {
|
||||
c.JSON(400, NewError(err))
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, res)
|
||||
}
|
||||
|
||||
func API_History(c *gin.Context) {
|
||||
c.JSON(200, dbClient.history)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user