Files
ulthon_admin/.agents/skills/ulthon-db-tools-debug/SKILL.md
2026-03-26 20:22:34 +08:00

36 lines
1015 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: "ulthon-db-tools-debug"
description: "封装 tools:db 命令的使用方法。需要快速查询/执行 SQL 或查看表信息进行调试时调用。"
---
# 内置数据库调试命令tools:db
## 何时调用
- 需要快速查看数据、验证 SQL、检查表结构字段/索引/行数)用于排错。
- 需要在不写临时代码的情况下做一次性查询或数据检查。
## 必须注意
- 这些命令用于“调试数据”,不要用来“设计表结构”。
- 如果为了排错临时改了表结构或数据,需要在任务结束前确保影响可控并记录变更点。
## 常用命令
```bash
php think tools:db:query
php think tools:db:execute
php think tools:db:table
php think tools:db:count
php think tools:db:info
php think tools:db:desc
```
通过 `--help` 查看每个命令参数说明。
## 使用建议
- 优先用 `query/desc/info/table/count` 做只读检查。
- 需要变更数据时再用 `execute`,并尽量将变更限制在最小范围。