Data Science Wire

Dimitri Fontaine: Introducing sqlfmt: an SQL gofmt-style formatter

PostgreSQL Planet1mo4 min read

Formatting SQL tends to bring some of the same questions again and again: should we uppercase clause keywords? should we put the separating comma at the start of a line to ease refactoring? how to align the SQL clauses with one-another? Over the years I have grown my own SQL style and didn’t find tooling that would implement it. Also, I’ve been asked here and there if there is a tool that would replicate The Art of PostgreSQL SQL indentation style… and now there is finally a good answer to that question! sqlfmt is a gofmt -style formatter that implements my own favorite SQL indentation style.

Read the full story at PostgreSQL Planet

More in Data Engineering