database-schema-validator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Database Schema Validator Skill

数据库Schema验证Skill

This skill ensures that all SQL files provided by the user comply with our strict database standards.
该Skill可确保用户提供的所有SQL文件符合我们严格的数据库标准。

Policies Enforced

强制执行的规范

  1. Safety: No
    DROP TABLE
    statements.
  2. Naming: All tables must use
    snake_case
    .
  3. Structure: Every table must have an
    id
    column as PRIMARY KEY.
  1. 安全规范:禁止使用
    DROP TABLE
    语句。
  2. 命名规范:所有表必须使用
    snake_case
    命名法。
  3. 结构规范:每张表必须包含一个
    id
    列作为主键。

Instructions

操作步骤

  1. Do not read the file manually to check for errors. The rules are complex and easily missed by eye.
  2. Run the Validation Script: Use the
    run_command
    tool to execute the python script provided in the
    scripts/
    folder against the user's file.
    bash
    python scripts/validate_schema.py <path_to_user_file>
  3. Interpret Output:
    • If the script returns exit code 0: Tell the user the schema looks good.
    • If the script returns exit code 1: Report the specific error messages printed by the script to the user and suggest fixes.
  1. 请勿手动读取文件检查错误。规则较为复杂,人工检查容易遗漏问题。
  2. 运行验证脚本: 使用
    run_command
    工具执行
    scripts/
    文件夹中提供的Python脚本,对用户的文件进行验证。
    bash
    python scripts/validate_schema.py <path_to_user_file>
  3. 解读输出结果:
    • 如果脚本返回退出码0:告知用户该Schema验证通过。
    • 如果脚本返回退出码1:将脚本输出的具体错误信息反馈给用户,并给出修复建议。