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

v1.0.1

根据提供的数据库表结构和自然语言需求生成规范、高效且包含中文注释的SELECT查询语句。

1· 240·1 current·1 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for fengnian2013/sql-generator-skill.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "提供数据库ddl内容,根据自然语言生成sql" (fengnian2013/sql-generator-skill) from ClawHub.
Skill page: https://clawhub.ai/fengnian2013/sql-generator-skill
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install fengnian2013/sql-generator-skill

ClawHub CLI

Package manager switcher

npx clawhub@latest install sql-generator-skill
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
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.
Assessment
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.

Like a lobster shell, security has layers — review code before you run it.

latestvk97bje7dbdqn7m9dsay2yb23cx83xykw
240downloads
1stars
2versions
Updated 4w ago
v1.0.1
MIT-0

SQL生成器技能

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

技能使用规则

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

输入参数

技能接收以下参数:

参数名类型必填说明
requirementstring自然语言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

Comments

Loading comments...