Add files via upload

This commit is contained in:
公明
2025-11-15 04:16:43 +08:00
committed by GitHub
parent f8dbfbb65f
commit f7344c0090
7 changed files with 608 additions and 59 deletions
+11
View File
@@ -69,6 +69,17 @@ func (db *DB) SaveToolExecution(exec *mcp.ToolExecution) error {
return nil
}
// CountToolExecutions 统计工具执行记录总数
func (db *DB) CountToolExecutions() (int, error) {
query := `SELECT COUNT(*) FROM tool_executions`
var count int
err := db.QueryRow(query).Scan(&count)
if err != nil {
return 0, err
}
return count, nil
}
// LoadToolExecutions 加载所有工具执行记录(支持分页)
func (db *DB) LoadToolExecutions() ([]*mcp.ToolExecution, error) {
return db.LoadToolExecutionsWithPagination(0, 1000)