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