← 返回 Skills 市场
fengnian2013

提供数据库ddl内容,根据自然语言生成sql

作者 fengnian2013 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
239
总下载
1
收藏
1
当前安装
2
版本数
在 OpenClaw 中安装
/install sql-generator-skill
功能描述
根据提供的数据库表结构和自然语言需求生成规范、高效且包含中文注释的SELECT查询语句。
使用说明 (SKILL.md)

SQL生成器技能

你是一个专业的SQL生成专家。根据用户提供的自然语言需求,自动提取产品名称并生成SQL SELECT查询语句。

技能使用规则

  1. 只生成SELECT语句 - 永远不要生成INSERT、UPDATE、DELETE或其他修改数据的SQL
  2. 遵循SQL规范 - 使用正确的语法,保持良好的格式化
  3. 添加中文注释 - 为表名、字段名添加中文注释,便于理解
  4. 考虑性能 - 生成的SQL应尽量高效,避免不必要的全表扫描
  5. 处理边界情况 - 考虑NULL值、类型转换等边界情况

输入参数

技能接收以下参数:

参数名 类型 必填 说明
requirement string 自然语言SQL需求,需要使用"产品名称"格式包裹产品名称

API地址拼接规则

技能会自动从需求中提取"产品名称",并拼接以下API地址:

  • 基础地址: https://open268v.cheyipai.com/img/c
  • 完整地址: https://open268v.cheyipai.com/img/c/{产品名称}.html

使用示例

示例1: 简单查询

输入:

我要查询"车牛拍"的数据,要求为查询所有竞拍信息

处理流程:

  1. 提取产品名称: 车牛拍
  2. 拼接API地址: https://open268v.cheyipai.com/img/c/车牛拍.html
  3. 请求API获取表结构
  4. 生成SQL

输出:

SELECT
    id,                     -- 竞拍id
    round_id,               -- 场次编号
    goods_id,               -- 商品编号
    preview_time,           -- 预展开始时间
    tender_begin_time,      -- 投标开始时间
    tender_end_time,        -- 投标结束时间
    auction_begin_time,     -- 竞拍开始时间
    auction_end_time,       -- 竞拍结束时间
    status,                 -- 竞拍状态
    auction_serial_number   -- 竞拍序号
FROM t_auction_baseinfo
ORDER BY auction_begin_time DESC
LIMIT 100;

示例2: 带条件查询

输入:

我要查询"车牛拍"的数据,要求为查询所有状态为竞拍中(status=3)的竞拍信息,按开始时间倒序

输出:

SELECT
    id,
    round_id,
    goods_id,
    auction_begin_time,
    auction_end_time,
    status,
    auction_serial_number
FROM t_auction_baseinfo
WHERE status = 3  -- 竞拍状态(3-竞拍中)
ORDER BY auction_begin_time DESC;

示例3: 分页查询

输入:

我要查询"车牛拍"的数据,要求为分页查询第1页,每页20条

输出:

SELECT
    id,
    round_id,
    goods_id,
    status,
    auction_begin_time,
    auction_end_time
FROM t_auction_baseinfo
ORDER BY auction_begin_time DESC
LIMIT 20 OFFSET 0;

注意事项

  1. 用户必须使用""包裹产品名称
  2. 如果未找到引号包裹的产品名称,将返回错误提示
  3. 生成的SQL只包含SELECT语句,不会生成修改数据的SQL
  4. 对于时间字段,注意处理时区问题
  5. 如果需求涉及聚合,请使用GROUP BY
安全使用建议
This skill is coherent for generating SELECT SQL, but it will make outbound HTTP requests to an external host (open268v.cheyipai.com by default) using the product name you include in quotes. Before installing or using it: 1) Confirm which API URL the runtime will actually call (manifest includes a hard-coded apiBaseUrl and config.json has an empty apiUrl — verify which will be used). 2) Only use with endpoints you trust (or host your own schema API), since product names or other fragments in the requirement will be sent to that server. 3) Avoid putting sensitive or internal identifiers in the natural-language requirement. 4) Test with non-sensitive examples first. If you need the skill to call a different schema service, ensure you can configure the apiUrl before use.
功能分析
Type: OpenClaw Skill Name: sql-generator-skill Version: 1.0.1 The skill is a specialized SQL generation tool designed to fetch database schema information from a specific domain (open268v.cheyipai.com) based on user-provided product names. All behaviors, including the network request for schema discovery and the restriction to SELECT statements, are clearly documented in SKILL.md and manifest.json. There is no evidence of malicious intent, credential theft, or unauthorized data exfiltration.
能力评估
Purpose & Capability
The name/description (generate SELECT SQL from DB schema + natural language) matches the instructions and manifest: the skill extracts a product name and requests a table-structure API to build SELECT statements. No unrelated binaries or credentials are requested.
Instruction Scope
SKILL.md instructs the agent to extract the quoted product name from user input and call a constructed URL (https://open268v.cheyipai.com/img/c/{产品名称}.html) to obtain table schema, then generate SELECT statements only. This is within scope, but it does perform outbound network calls using user-provided content (the product name), which can leak that fragment to the remote host. The skill does not instruct reading local files or environment variables.
Install Mechanism
Instruction-only skill with no install spec and no code files executed locally — lowest-risk install surface.
Credentials
No environment variables, credentials, or config paths are required. The only external data sent is the product name embedded into the API URL (expected for fetching schema), so requested access is minimal and proportionate to the stated purpose.
Persistence & Privilege
Skill is not always-enabled and does not request persistent or elevated platform privileges. It does not modify other skills or system-wide configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install sql-generator-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /sql-generator-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
**Summary:** 增加了对“产品名称”提取和API地址拼接的新能力,并加入详细的使用示例和参数说明。 - 新增自动提取中文引号包裹的产品名称,根据产品名称拼接API地址并请求表结构。 - 明确输入参数 requirement,要求产品名称需用引号包裹。 - 文件增加完整的输入输出示例,说明各类查询(普通、条件、分页)写法。 - 新增 API 拼接规则与注意事项,包含异常处理和字段说明。 - 仅支持SELECT查询,依然遵循SQL规范和性能优化等原则。
v1.0.0
Initial release of SQL生成器技能: - Generates standardized SELECT SQL queries based on table structure and user input. - Enforces SQL formatting, optimization, and performance best practices. - All fields and tables are annotated with Chinese comments for clarity. - Handles edge cases such as NULL values and type conversion. - Only supports SELECT statements—no data modification queries.
元数据
Slug sql-generator-skill
版本 1.0.1
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 2
常见问题

提供数据库ddl内容,根据自然语言生成sql 是什么?

根据提供的数据库表结构和自然语言需求生成规范、高效且包含中文注释的SELECT查询语句。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 239 次。

如何安装 提供数据库ddl内容,根据自然语言生成sql?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install sql-generator-skill」即可一键安装,无需额外配置。

提供数据库ddl内容,根据自然语言生成sql 是免费的吗?

是的,提供数据库ddl内容,根据自然语言生成sql 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

提供数据库ddl内容,根据自然语言生成sql 支持哪些平台?

提供数据库ddl内容,根据自然语言生成sql 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 提供数据库ddl内容,根据自然语言生成sql?

由 fengnian2013(@fengnian2013)开发并维护,当前版本 v1.0.1。

💬 留言讨论