This is a fork from SublimeFormatSQL that fixes a known issue with Sublime Text 2. There will be no support for Sublime Text 3.
Because this isn't an official package, you can follow this instructions to install.
From the original README:
FormatSQL formats long SQL statement to a more readable form by using python-sqlparse library.
select sql and click menu Selection -> Format -> SQL
add the following line to keymap settings
{ "keys": ["super+k", "super+s"], "command": "format_sql" },
Original:
select a,b from foo join bar on val1 = val2 where id = 123 and cd = 99;
Formated:
SELECT a,
b
FROM foo
JOIN bar ON val1 = val2
WHERE id = 123
AND cd = 99;
python-sqlparse library and this code are both on 2-clauses BSD