SqlBeautifier
A sublime plugin to format SQL. It supports both sublime 2 and 3.
Details
Installs
- Total 103K
- Win 56K
- Mac 33K
- Linux 14K
Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | Jan 8 | Jan 7 | Jan 6 | Jan 5 | Jan 4 | Jan 3 | Jan 2 | Jan 1 | Dec 31 | Dec 30 | Dec 29 | Dec 28 | Dec 27 | Dec 26 | Dec 25 | Dec 24 | Dec 23 | Dec 22 | Dec 21 | Dec 20 | Dec 19 | Dec 18 | Dec 17 | Dec 16 | Dec 15 | Dec 14 | Dec 13 | Dec 12 | Dec 11 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 8 | 6 | 10 | 25 | 28 | 25 | 32 | 22 | 9 | 8 | 34 | 35 | 43 | 24 | 29 | 10 | 2 | 36 | 23 | 40 | 46 | 30 | 7 | 8 | 5 | 25 | 30 | 23 | 41 | 7 | 4 | 27 | 19 | 28 | 34 | 26 | 19 | 9 | 28 | 38 | 34 | 35 | 34 | 9 | 8 | 38 |
Mac | 4 | 9 | 7 | 27 | 21 | 32 | 17 | 20 | 7 | 5 | 17 | 27 | 28 | 26 | 28 | 7 | 12 | 19 | 24 | 30 | 31 | 19 | 4 | 1 | 1 | 11 | 18 | 18 | 18 | 10 | 7 | 11 | 10 | 17 | 26 | 30 | 9 | 11 | 13 | 17 | 27 | 27 | 22 | 6 | 8 | 27 |
Linux | 1 | 3 | 4 | 5 | 5 | 1 | 3 | 2 | 3 | 1 | 5 | 6 | 1 | 7 | 6 | 2 | 2 | 6 | 5 | 7 | 9 | 7 | 1 | 0 | 0 | 1 | 2 | 3 | 6 | 3 | 0 | 2 | 1 | 7 | 3 | 2 | 0 | 2 | 5 | 7 | 6 | 7 | 5 | 1 | 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.