SqlBeautifier
A sublime plugin to format SQL. It supports both sublime 2 and 3.
Details
Installs
- Total 139K
- Win 75K
- Mac 48K
- Linux 17K
Dec 5 | Dec 4 | Dec 3 | Dec 2 | Dec 1 | Nov 30 | Nov 29 | Nov 28 | Nov 27 | Nov 26 | Nov 25 | Nov 24 | Nov 23 | Nov 22 | Nov 21 | Nov 20 | Nov 19 | Nov 18 | Nov 17 | Nov 16 | Nov 15 | Nov 14 | Nov 13 | Nov 12 | Nov 11 | Nov 10 | Nov 9 | Nov 8 | Nov 7 | Nov 6 | Nov 5 | Nov 4 | Nov 3 | Nov 2 | Nov 1 | Oct 31 | Oct 30 | Oct 29 | Oct 28 | Oct 27 | Oct 26 | Oct 25 | Oct 24 | Oct 23 | Oct 22 | Oct 21 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 7 | 15 | 3 | 3 | 25 | 29 | 45 | 18 | 9 | 3 | 5 | 21 | 24 | 19 | 20 | 17 | 1 | 7 | 17 | 22 | 12 | 34 | 17 | 5 | 6 | 27 | 20 | 31 | 33 | 18 | 9 | 6 | 17 | 22 | 37 | 23 | 21 | 5 | 8 | 24 | 17 | 28 | 18 | 24 | 5 | 3 |
Mac | 13 | 14 | 6 | 5 | 16 | 23 | 16 | 11 | 19 | 2 | 6 | 9 | 18 | 21 | 19 | 12 | 4 | 5 | 19 | 17 | 21 | 12 | 18 | 10 | 7 | 16 | 19 | 14 | 18 | 12 | 2 | 3 | 16 | 29 | 15 | 15 | 16 | 2 | 2 | 11 | 24 | 16 | 13 | 16 | 3 | 4 |
Linux | 3 | 1 | 3 | 0 | 1 | 3 | 2 | 5 | 7 | 2 | 1 | 2 | 2 | 2 | 3 | 3 | 2 | 1 | 2 | 4 | 2 | 4 | 3 | 0 | 1 | 3 | 5 | 1 | 3 | 3 | 1 | 4 | 3 | 5 | 1 | 2 | 3 | 0 | 1 | 4 | 8 | 5 | 2 | 1 | 0 | 0 |
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.