Have you ever wished there were a simpler way of writing well-formatted SQL in your code editors? Well, in TeamSQL, there is.
We recently introduced support for editor extensions, which are extensions that modify the way the editor in TeamSQL works. One of the first extensions that we created with this framework is Beautify SQL, which does exactly what you think it does: you type in SQL, Beautify SQL cleans it up.
Let’s say that you wrote the following SQL statement:
While what we wrote is functionally correct, we can use Beautify SQL to format it in a way that’s easier for people to read. We can use clean up our SQL using Beautify SQL in one of two ways:
- Keyboard Shortcuts:
- macOS: Option + Shift + F
- Windows/Linux: Alt + Shift + F
- Options Menu: right-click anywhere in the editor window and select Beautify Query
This is what our formatted SQL statement looks like:
How to Install
If you don’t have the Beautify SQL extension installed, you can do so via the Extensions store. The Extensions Store is accessible using the puzzle iconlocated at the left of your TeamSQL instance.
Find the extension you want to install in the left-hand menu, and click to open its page. Click Install to proceed.
When the extension is finished installing, you’ll be prompted to reload TeamSQL.
Once TeamSQL reloads, you’re ready to use Beautify SQL.