4 ms·
Is there a good sql autoformatter? For cleaning up ORM-generated queries so I can read them. I've used python's sqlparse but it produces output that's often sti
by craigds 10y ago
Is there a good sql autoformatter? For cleaning up ORM-generated queries so I can read them. I've used python's sqlparse but it produces output that's often still unreadable.
- lunchladydoris 10y agoIf Oracle is your flavour of SQL, PL/SQL Developer is very nice and has a good formatter built in.
- krylon 10y agoIf you happen to use MS SQL Server, there is ApexSQL Refactor, a plugin to SQL Server Management Studio (https://www.apexsql.com/sql_tools_refactor.aspx https://www.apexsql.com/sql_tools_refactor.aspx). As the name implies it mainly does stuff other than formatting, but the latter is what I use it for, and I am rather happy with it. When I write SQL myself, I tend for format it rather scrupulously, but when I have to read SQL written by somebody else, it is very useful.
- mvdwoord 10y agoI have used this quite a bit.. http://www.dpriver.com/pp/sqlformat.htm http://www.dpriver.com/pp/sqlformat.htm
- jdwyah 10y agoIntelliJ's SQL editor is fabulous. Auto formatting and superb autocomplete, even with aliased tables and CTEs. If you don't want the full IntelliJ you can get Datagrip which is just the DB part. Can't say enough nice things about it.
- jdwyah 10y agoIntelliJ's SQL editor is fabulous. Auto formatting and superb autocomplete, even with aliased tables and CTEs. If you don't want the full IntelliJ you can get Datagrip which is just the DB part. Can't say enough nice things about it.
- sundvor 10y agoRedgate's SQL Prompt has a great auto formatter with definable rule sets, if you use SSMS - and have the budget for it.
- ScaryDBA 10y agoIf you like the formatter in the current version of Prompt, wait until you see what's coming out in version 7.3. They've gone nuts. The new mechanisms for formatting are far beyond anything we've had so far. I'm pretty jazzed about it (disclosure: I work for Redgate).