OpenParable
Skip to content
← Back to skills

SQL

Development
sql

SQL is an Agent Skill for development published in the Zafer-Liu/Data-Analysis-Agent repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

使用 SQL 安全查询当前已选择的数据表

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/Zafer-Liu/Data-Analysis-Agent/blob/HEAD/skills/sql/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/sql, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

SQL 查询

先读取已授权分析表的 schema,确认真实表名与字段名,再编写只读 SQL。优先聚合并限制返回行数,不猜测字段;SQL 数据源只能查询用户已选择的分析表。解释查询口径并总结结果。

Tool routing

  1. Use get_schema before writing SQL to confirm real table and field names.
  2. Use get_table_detail when a specific table needs deeper metadata.
  3. Use query_data for read-only SQL. Prefer aggregate queries and explicit LIMIT for previews.
  4. Do not use write, export, cleanup, or analysis tools from this skill.

Implementation reference

  • Schema/query tool entries: agent/tools/business/data.py::_tool_get_schema, agent/tools/business/data.py::_tool_get_table_detail, agent/tools/business/data.py::_tool_query_data
  • SQL validation: agent/validate.py