SqlBeautifier
A sublime plugin to format SQL. It supports both sublime 2 and 3.
Details
Installs
- Total 152K
- Win 81K
- Mac 53K
- Linux 18K
Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | Aug 2 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 6 | 2 | 0 | 12 | 13 | 15 | 18 | 11 | 2 | 3 | 12 | 14 | 14 | 9 | 13 | 1 | 1 | 9 | 13 | 15 | 13 | 12 | 2 | 2 | 7 | 7 | 18 | 17 | 13 | 2 | 1 | 11 | 18 | 10 | 16 | 13 | 3 | 3 | 10 | 13 | 18 | 12 | 14 | 3 | 3 |
Mac | 0 | 11 | 3 | 5 | 11 | 12 | 5 | 15 | 5 | 3 | 3 | 12 | 12 | 7 | 16 | 6 | 1 | 2 | 12 | 11 | 12 | 16 | 9 | 1 | 2 | 13 | 21 | 14 | 16 | 6 | 3 | 2 | 10 | 16 | 13 | 13 | 7 | 5 | 2 | 10 | 9 | 19 | 9 | 13 | 3 | 3 |
Linux | 0 | 4 | 0 | 0 | 0 | 3 | 2 | 3 | 4 | 2 | 3 | 2 | 1 | 2 | 3 | 3 | 2 | 0 | 1 | 2 | 3 | 3 | 3 | 0 | 0 | 4 | 3 | 5 | 4 | 4 | 0 | 1 | 2 | 1 | 1 | 1 | 1 | 0 | 0 | 3 | 2 | 1 | 3 | 4 | 1 | 1 |
Readme
- Source
- raw.githubusercontent.com
SqlBeautifier
This is a SQL formatter plugin using python-sqlparse for both Sublime 2 and 3.
Enjoy!
Installation
Please install Sublime Package Control first. Then inside Package Control: Install Package, type SqlBeautifier and then click to confirm.
Settings
The default key binding for Mac is
{ "keys": ["super+k", "super+f"], "command": "sql_beautifier" }
- Kindly note that the
super
key here is generally replaced byCommand (⌘)
key
The default key binding for Windows / Linux is
{ "keys": ["ctrl+k", "ctrl+f"], "command": "sql_beautifier" }
Options for formatter
To change the options, click through Package Settings -> Sql Beautifier -> Settings User and add the overrided options in JSON like this
{
"indent_tabs": true,
"indent_width": 1
}
This overrides the default option at Package Settings -> Sql Beautifier -> Settings Default.
Here is the list of options the formatter supports:
keyword_case: Changes how keywords are formatted. Allowed values are “upper”, “lower” and “capitalize” and null (leaves case intact).
identifier_case: Changes how identifiers are formatted. Allowed values are “upper”, “lower”, and “capitalize” and null (leaves case intact).
strip_comments: If True comments are removed from the statements.
reindent: If True the indentations of the statements are changed.
indent_tabs: If True tabs instead of spaces are used for indentation.
indent_width: The width of the indentation, defaults to 2.