shandy-sqlfmt extension for VSCode
A Visual Studio Code extension for shandy-sqlfmt. Available on the Visual Studio Marketplace.
Usage
Install shandy-sqlfmt
Please install shandy-sqlfmt first.
This extension will automatically detect the sqlfmt
command in your workspace, and if can't find it, it will find it in your $PATH
.
Global install
pipx install shandy-sqlfmt[jinja]
Local install
# Use your virtualenv tool
cd workspace
python -m venv .venv
source .venv/bin/activate
pip install shandy-sqlfmt[jinja]
Example configuration
You can configure shandy-sqlfmt to format SQL or Jinja-SQL on-save by enabling the editor.formatOnSave
action in settings.json
, and setting shandy-sqlfmt as your default formatter.
{
"[sql]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "yassun7010.shandy-sqlfmt"
},
"[jinja-sql]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "yassun7010.shandy-sqlfmt"
}
}
Commands
Command |
Description |
shandy-sqlfmt: Format Workspace |
Format all SQL files in workspace. |
License
MIT