Formatting SQL in VS Code

Hi peeps,

I’m not sure this is the right place to ask. But did anyone have formatted his SQL-Code in the tool VS-Code concerning to a certain/own style? Is it possible to adapt to a certain style and format the code to your personal needs?

Thanks a lot!
Michel

Hi, I spent quick some time to find something good, but couldn’t.
having said that, there are many extensions that might be helpful, I didn’t had change to check them all

what i do is format the SQL in workbench and then past it to the VS-code.

I’ll be happy to here if you find a better way
FYI i use the jijna-sql extension in VS-Code

Hi,
We don’t have a VS Code extension built just yet, but there is now a CLI tool that auto-formats SQL that is compatible with dbt and jinja templating.

For more info visit sqlfmt.com, and if you have any questions, please let me know!

or use sqlfluff. Install using pip, integrate in your repo and I found their rules had the right level of customization.