SkillAgentSearch skills...

SublimeFormatSQL

Sublime Text 2 command to format long SQL statement to a more readable form (also available via Package Control)

Install / Use

/learn @du-song/SublimeFormatSQL
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Summary

FormatSQL formats long SQL statement to a more readable form by using python-sqlparse library.

How to Use

select sql and click menu Selection -> Format -> SQL

Configure key binding

add the following line to keymap settings

{ "keys": ["super+k", "super+s"], "command": "format_sql" },

Example

Original:

select a,b from foo join bar on val1 = val2 where id = 123 and cd = 99;

Formated:

SELECT a,
       b
FROM foo
JOIN bar ON val1 = val2
WHERE id = 123
    AND cd = 99;

License

python-sqlparse library and this code are both on 2-clauses BSD

View on GitHub
GitHub Stars112
CategoryData
Updated1y ago
Forks40

Languages

Python

Security Score

70/100

Audited on Oct 5, 2024

No findings