Sqlfmt: an opinionated online SQL formatter
cockroachlabs.com
Sqlfmt: an opinionated online SQL formatter
1–10 of 94 posts
Re: Sqlfmt: an opinionated online SQL formatter
#2Re: Sqlfmt: an opinionated online SQL formatter
#3I work on a project that's grown in complexity and team size. Developers have come and gone. Sometimes a bit of code that's grown over a few years needs its style to evolve. This kind of formatter clearly realizes this.
What I tell developers that complain about this or that style is that it's more important to have a consistent code style throughout the lifetime of a project, then to adopt whatever bracing style someone happens to like at the time.
I'd really like all of my code to be automatically formatted with a tool like this, as part of the build process. This would help with situations where code evolves, as it would reformat it when needed.
Re: Sqlfmt: an opinionated online SQL formatter
#4Re: Sqlfmt: an opinionated online SQL formatter
#5I'm sad this isn't available as a binary, it's not much use to me as a website.
Re: Sqlfmt: an opinionated online SQL formatter
#6that would be really cool to have as a local package you can plug into your text editor instead of copy and paste. people using this at companies might leak sensitive information or possible attack vectors to the opaque service.
Re: Sqlfmt: an opinionated online SQL formatter
#7Re: Sqlfmt: an opinionated online SQL formatter
#8I'm sad this isn't available as a binary, it's not much use to me as a website.
Re: Sqlfmt: an opinionated online SQL formatter
#9I have to say, I do most of my development work in the database, and I'm not thrilled with any of the automatic formatters thus far. The ones I've seen can do a good job in many cases, but if you start getting very advanced at all, the weaknesses of an automatic formatting approach start to become more evident. It may just be that anything other than relatively simple SQL, PL/SQL are not well suited for automatic formatting.
I'm still working through a good set of formatting rules, and I always find I end up making exceptions for readability.
Re: Sqlfmt: an opinionated online SQL formatter
#10standalone Query parser would be nice :)
(this uses the actual Postgres parser wrapped into a library)