I searched around and found
https://github.com/jackc/sqlfmt, which is an older open source project also called sqlfmt, also written in Go. I don't know anything about how they compare.
It simply doesn't work with cockroachdb it throws syntax errors with valid schemas/queries.