Want to test out sqlfmt on a query before you install it? Go to sqlfmt.com to use the interactive, web-based version.
📄️ Using sqlfmt
sqlfmt is an alpha product and will not always produce the formatted output you might want. It might even break your SQL syntax.
📄️ Configuring sqlfmt
You probably don't need to configure sqlfmt at all! sqlfmt supports nearly all SQL dialects without configuration, and doesn't require a Jinja templater.
📄️ Disabling sqlfmt
If you would like sqlfmt to ignore a file, or part of a file, you can add -- fmt on comments to your code (or # fmt off at the top of a file will keep the entire file intact.
📄️ Formatting Jinja
sqlfmt loves properly-formatted Jinja, too.
📄️ Using sqlfmt in a Container
We build official container images with every release of sqlfmt (since v0.15.0) and push them to GHCR (the GitHub Container Registry). With Docker installed, you can run sqlfmt to format all files in your current working directory with:
📄️ Improving Git Blame
When running sqlfmt for the first time, or when running an upgraded version of sqlfmt after a style change, you are likely to produce a large number of changes in your codebase.
📄️ About File Encodings
You probably don't have to worry about this.