← 返回 Skills 市场
johnnywang2001

Sql Formatter

作者 John Wang · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
163
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install sql-formatter
功能描述
Format, minify, and lint SQL queries from the command line. Formats SQL with proper indentation and keyword casing, minifies by removing whitespace and comme...
使用说明 (SKILL.md)

SQL Formatter

Format, minify, and lint SQL with zero dependencies.

Commands

All commands use scripts/sql_format.py.

Format SQL

python3 scripts/sql_format.py format --sql "SELECT id, name FROM users WHERE active = true"
python3 scripts/sql_format.py format --input query.sql
python3 scripts/sql_format.py format --input query.sql --output formatted.sql
python3 scripts/sql_format.py format --input query.sql --indent 4 --lowercase
echo "SELECT * FROM t" | python3 scripts/sql_format.py format --input -

Adds line breaks before major clauses (SELECT, FROM, WHERE, JOIN, ORDER BY, etc.), indents AND/OR/ON, and uppercases keywords by default.

Minify SQL

python3 scripts/sql_format.py minify --sql "SELECT  id,  name  FROM  users  -- comment"
python3 scripts/sql_format.py minify --input query.sql

Strips comments, collapses whitespace, removes unnecessary spaces around parentheses and commas.

Lint SQL

python3 scripts/sql_format.py lint --input query.sql
python3 scripts/sql_format.py lint --sql "SELECT * FROM users WHERE 1=1" --json

Checks for: SELECT *, multiple spaces, tabs, != vs \x3C>, double commas, WHERE 1=1, long lines (>120 chars), trailing whitespace, missing semicolons, inconsistent keyword casing.

Supported SQL

Handles SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, WITH (CTEs), JOINs (all types), subqueries, string literals, double-quoted identifiers, single-line and multi-line comments.

安全使用建议
This skill appears to be a local, dependency-free SQL formatter/linter and is internally consistent with that purpose. Before installing or running it, (1) review the full scripts/sql_format.py file (the prompt showed a truncated tail) to ensure there are no hidden network calls or file-system operations you don't expect; (2) run the script on non-sensitive sample files first or inside a sandbox if you are unsure of the source; and (3) prefer installing only skills from authors you trust or with a published homepage/repository if you plan to run them on sensitive data.
功能分析
Type: OpenClaw Skill Name: sql-formatter Version: 1.0.0 The skill is a standard SQL utility for formatting, minifying, and linting SQL queries. The Python script `scripts/sql_format.py` uses only the standard library and contains no network calls, shell execution, or data exfiltration logic. The instructions in `SKILL.md` are well-aligned with the stated functionality and do not contain any prompt injection attempts or suspicious commands.
能力评估
Purpose & Capability
Name/description match the included Python script and SKILL.md. The skill formats, minifies, and lints SQL using a local Python script; no unexpected services, credentials, or binaries are required.
Instruction Scope
SKILL.md instructs the agent/user to run scripts/sql_format.py against provided SQL (files or stdin). The instructions reference only input/output paths and formatting options — they do not ask the agent to read unrelated files, environment variables, or contact external endpoints.
Install Mechanism
No install spec; this is instruction-only with an included Python script. That is proportionate for a pure-Python, zero-dependency tool.
Credentials
No environment variables, credentials, or config paths are requested. The script imports only standard-library modules (argparse, re, sys, json) and processes supplied files/STDIN — proportional to the stated functionality.
Persistence & Privilege
Skill does not request always:true and does not modify other skills or system settings. It runs on-demand using a local script, which is appropriate.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install sql-formatter
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /sql-formatter 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release of SQL Formatter: - Format, minify, and lint SQL queries directly from the command line. - Provides formatting with indentation and configurable keyword casing. - Minifies SQL by removing comments and collapsing whitespace. - Lints for common SQL anti-patterns (e.g., SELECT *, missing semicolons, long lines). - No external dependencies; implemented in pure Python. - Supports major SQL statement types, including SELECT, INSERT, UPDATE, DELETE, CTEs, and various JOINs.
元数据
Slug sql-formatter
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Sql Formatter 是什么?

Format, minify, and lint SQL queries from the command line. Formats SQL with proper indentation and keyword casing, minifies by removing whitespace and comme... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 163 次。

如何安装 Sql Formatter?

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

Sql Formatter 是免费的吗?

是的,Sql Formatter 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Sql Formatter 支持哪些平台?

Sql Formatter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Sql Formatter?

由 John Wang(@johnnywang2001)开发并维护,当前版本 v1.0.0。

💬 留言讨论