# Introducing sqlfmt: an SQL gofmt-style formatter

DevFeed: [Introducing sqlfmt: an SQL gofmt-style formatter](<https://devfeed.tech/articles/introducing-sqlfmt-an-sql-gofmt-style-formatter-34619.md>)

Original publisher: [Read original article](<https://tapoueh.org/blog/2026/08/introducing-sqlfmt-an-sql-gofmt-style-formatter/>)

Author: Dimitri Fontaine PostgreSQL Major Contributor; Author

Published: 2026-08-11T12:30:37Z

Content type: release

Language: en

Sources: [Dimitri Fontaine](<https://devfeed.tech/sources/dimitri-fontaine.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [formatting](<https://devfeed.tech/topics/formatting.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [WebAssembly](<https://devfeed.tech/topics/web-assembly.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>)

Tags: [formatting](<https://devfeed.tech/tags/formatting.md>), [go](<https://devfeed.tech/tags/go.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [sql](<https://devfeed.tech/tags/sql.md>), [tooling](<https://devfeed.tech/tags/tooling.md>), [webassembly](<https://devfeed.tech/tags/webassembly.md>)

## AI overview

The article introduces sqlfmt, a gofmt-style SQL formatter based on the author's SQL indentation conventions from The Art of PostgreSQL. It uses a single opinionated style with no configuration options, including river alignment and specific rules for keywords, commas, continuation lines, data types, and comments. The formatter is available through a CLI and a WebAssembly-based web tool.

## Source excerpt

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. One opinionated style, no configuration knobs. Run it, commit the result, move on.