dbt Power User (VS Code Extension)
The Extension has many features, including a sqlfmt-powered formatter.
sqlfmt must be available on the PATH in order to be accessed by dbt Power User. Install sqlfmt with
pipx to isolate its dependencies and add it to the PATH.
After installing sqlfmt and the dbt Power User extension:
.sqlfiles with the
jinja-sqllanguage. Select Preferences > Settings, and under Files: Associations click Add Item:
Alternatively, add the following to your VS Code
Select "dbt Power User" (extension
id:innoverio.vscode-dbt-power-user) as the default formatter. You can do this either by using the context menu (right click on an open dbt model in the editor) and select "Format Document With...", or you can add the following to your VS Code settings:settings.json
You can enable format on save by adding another line to your VS Code settings:settings.json