Format SQL Statement


#1

I would love to see a Format SQL Statement function for Atom.

For example if I type in select a,b from foo join bar on val1 = val2 where id = 123 and cd = 99; there should be a button where I can automatically convert this statement into this:

SELECT a, b FROM foo JOIN bar ON val1 = val2 WHERE id = 123 AND cd = 99;

There is already a repository that incorporates this function into Sublime so perhaps this is something that could be forked for Atom?

Thanks!


#2

Unfortunately it can’t be forked to create an Atom package directly, because SublimeFormatSQL uses Python and Atom uses Coffeescript, but this looks like a great opportunity to create a new package.

https://atom.io/docs/latest/creating-a-package

Update 1:
I couldn’t resist and I started working on a new package. I’m going to upload it soon.

Update 2:
I did it https://atom.io/packages/format-sql