Show list of databases and allow switching by clicking on current database name
This commit is contained in:
@@ -127,6 +127,9 @@ func SwitchDb(c *gin.Context) {
|
||||
}
|
||||
|
||||
name := c.Request.URL.Query().Get("db")
|
||||
if name == "" {
|
||||
name = c.Request.FormValue("db")
|
||||
}
|
||||
if name == "" {
|
||||
c.JSON(400, Error{"Database name is not provided"})
|
||||
return
|
||||
@@ -168,6 +171,8 @@ func SwitchDb(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
conn.Close()
|
||||
|
||||
c.JSON(200, info.Format()[0])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user