SqlBeautifier
A sublime plugin to format SQL. It supports both sublime 2 and 3.
Details
Installs
- Total 149K
- Win 80K
- Mac 52K
- Linux 18K
Mar 30 | Mar 29 | Mar 28 | Mar 27 | Mar 26 | Mar 25 | Mar 24 | Mar 23 | Mar 22 | Mar 21 | Mar 20 | Mar 19 | Mar 18 | Mar 17 | Mar 16 | Mar 15 | Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | Mar 4 | Mar 3 | Mar 2 | Mar 1 | Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 5 | 14 | 13 | 24 | 22 | 18 | 3 | 7 | 20 | 15 | 17 | 24 | 18 | 0 | 4 | 13 | 11 | 25 | 16 | 12 | 2 | 3 | 16 | 23 | 15 | 20 | 13 | 2 | 4 | 15 | 20 | 20 | 14 | 15 | 0 | 7 | 15 | 8 | 14 | 21 | 15 | 5 | 4 | 19 | 17 |
Mac | 1 | 4 | 15 | 18 | 13 | 12 | 10 | 3 | 4 | 15 | 18 | 12 | 11 | 19 | 4 | 10 | 12 | 16 | 18 | 15 | 23 | 3 | 4 | 7 | 12 | 13 | 8 | 14 | 2 | 3 | 10 | 13 | 12 | 18 | 9 | 5 | 6 | 5 | 16 | 16 | 9 | 15 | 3 | 3 | 13 | 9 |
Linux | 0 | 2 | 4 | 2 | 3 | 5 | 0 | 0 | 0 | 5 | 2 | 3 | 2 | 2 | 5 | 1 | 3 | 1 | 2 | 5 | 3 | 2 | 2 | 2 | 1 | 2 | 1 | 0 | 1 | 3 | 1 | 1 | 5 | 4 | 3 | 0 | 1 | 3 | 1 | 1 | 1 | 4 | 0 | 4 | 2 | 3 |
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.