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