mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-05 09:30:24 +08:00
增加两个数据库相关调试命令
This commit is contained in:
@@ -585,8 +585,22 @@ func (this *APINode) listenSock() error {
|
||||
_ = cmd.Reply(&gosock.Command{
|
||||
Params: map[string]interface{}{"debug": teaconst.Debug},
|
||||
})
|
||||
case "db.stmt":
|
||||
dbs.ShowPreparedStatements = true
|
||||
case "db.stmt.prepare":
|
||||
dbs.ShowPreparedStatements = !dbs.ShowPreparedStatements
|
||||
_ = cmd.Reply(&gosock.Command{
|
||||
Params: map[string]interface{}{"isOn": dbs.ShowPreparedStatements},
|
||||
})
|
||||
case "db.stmt.count":
|
||||
db, _ := dbs.Default()
|
||||
if db != nil {
|
||||
_ = cmd.Reply(&gosock.Command{
|
||||
Params: map[string]interface{}{"count": db.StmtManager().Len()},
|
||||
})
|
||||
} else {
|
||||
_ = cmd.Reply(&gosock.Command{
|
||||
Params: map[string]interface{}{"count": 0},
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user