Skip to content
Skills Library
Programming · Conversion & formats

sql-formatting

/sql-formatting

Format or pretty-print SQL with GoSQLX - consistent indentation, keyword casing and optional trailing semicolon. Use when the user asks to format, beautify, pretty-print, reindent or clean up SQL, or to make a .sql file consistent.

Repository
gosqlx ↗
Licence
Apache-2.0
Last repository change
28.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 28.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What it does and when to use it

Format or pretty-print SQL with GoSQLX - consistent indentation, keyword casing and optional trailing semicolon. Use when the user asks to format, beautify, pretty-print, reindent or clean up SQL, or to make a .sql file consistent.

Arguments

/sql-formatting [SQL string or path to .sql file]
Original author description

Format or pretty-print SQL with GoSQLX - consistent indentation, keyword casing and optional trailing semicolon. Use when the user asks to format, beautify, pretty-print, reindent or clean up SQL, or to make a .sql file consistent.

How it works

  1. Steps
  2. Fallback when the MCP tools are unavailable
Original SKILL.md headings · 31 lines, 293 words
SKILL.md preview
---
name: sql-formatting
description: Format or pretty-print SQL with GoSQLX - consistent indentation, keyword casing and optional trailing semicolon. Use when the user asks to format, beautify, pretty-print, reindent or clean up SQL, or to make a .sql file consistent.
argument-hint: "[SQL string or path to .sql file]"
allowed-tools: mcp__plugin_gosqlx_gosqlx__format_sql mcp__plugin_gosqlx_gosqlx__validate_sql Read Bash(gosqlx format:*)
---

# SQL formatting with GoSQLX

Input: `$ARGUMENTS` - a SQL string or a path to a `.sql` file.

## Steps

1. Get the SQL (read the file if a path was given).
2. Call `format_sql` (`mcp__plugin_gosqlx_gosqlx__format_sql`) with:
   - `sql` (required)
   - `indent_size` - integer 0–16, default 2. `0` puts each statement on one line. Clauses always start at column 0; larger values only indent nested blocks such as CREATE TABLE column lists
   - `uppercase_keywords` - `true` upper-cases all keywords (`AND`, `IN`, `CASE`, ...) but not data type names such as `int`. The default `false` still upper-cases clause keywords (`SELECT`, `FROM`, `WHERE`, ...) and leaves others such as `and`/`or` as written; the MCP tool cannot lowercase keywords
   - `add_semicolon` - default `false`
3. If formatting fails, the SQL probably does not parse: call `validate_sql` and report the error instead of guessing a fix.
4. Show the formatted SQL in a fenced `sql` block. When the input was a file, write the result back only if the user asked you to change the file; otherwise show it.

Formatting is whitespace and keyword-case only - it must not change meaning. If the output appears to drop or alter anything (comments, hints, dialect syntax), say so and keep the original.

## Fallback when the MCP tools are unavailable

```sh
gosqlx format query.sql                 # print formatted SQL (keywords uppercased by default)
gosqlx format --indent 4 query.sql
gosqlx format --uppercase=false query.sql  # lowercase clause keywords (do not use --no-uppercase: it currently uppercases)
gosqlx format --check query.sql         # exit non-zero if the file needs formatting
gosqlx format -i query.sql              # rewrite in place - only when asked
echo "select a from b" | gosqlx format
```

Both upper-case clause keywords by default. For lowercase keywords use the CLI with `--uppercase=false`.

Versions

RepositoryScoreLicence
This page · ajitpratap0/gosqlx100Apache-2.0
jgpruitt/sql-formatting100MIT

Database snapshot: 13.11.2026 · package version 3447d556965b (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100sql-linting
    Lint SQL with GoSQLX and explain its rules L001-L030 (whitespace, keyword case, comma placement, aliasing, plus safety, performance and naming rules), including which rules each entry point applies and which can be auto-fixed. Use when the user asks to lint SQL, enforce SQL…
  • 100format
    Format SQL files using the syntaqlite formatter. Use when the user wants to format, reformat, or pretty-print SQL code.
  • 100sql-analysis
    Full GoSQLX review of a SQL query or .sql file - syntax validity, statement types, referenced tables/columns/functions, injection patterns, style lint and a formatted version - followed by a plain-language explanation of what the SQL does and what to fix. Use when the user asks…
  • 95sql-formatter
    This skill should be used when the user asks to format SQL code, polish SQL queries, improve SQL readability, or work with .sql files. Use when queries mention SQL formatting, code beautification, Oracle SQL, or database query polishing.
  • 100pure-code-style
    Reformats a .pure file (or a block of Pure code) to a consistent house style: 2-space indentation with no column-aligned hanging indents, tight colons in type annotations, spaced pipes on if/match/lambda branches, one-parameter-per-line for long function signatures, and no stray…
  • 96s03-06-sql-scripts
    生成建表脚本、初始化数据与可回滚的迁移脚本。当用户要求'生成建库脚本/迁移 SQL/初始化数据'时使用。产出 .sql 文件与迁移说明。

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.