This is an extension for Devoted Health Snowflake SQL tooling.
If you're external to Devoted Health, this will be pretty lackluster for you:
- The formatting depends on an internal binary which isn't ready for public consumption
- You'll be better off using one of the other SQL formatters
Unfortunately, there aren't private publishing options so this is the only way for us to distribute this to our employees.
Usage
After installing, make sure your file type is snowflake
in the lower right hand corner (and not SQL or something like that).
If you mostly work with snowflake files and want all .sql
files to be snowflake, set the files.association
setting either via settings.json or the Settings UI.
"files.associations": {
"*.sql": "snowflake"
}
If you find that snowflakefmt
is not formatting your text well or not able to parse your sql code, add the following as the first line in the file.
-- dialect:nofmt
There's some naive context-unaware autocomplete (ie TRUE
is a good completion to CREATE T
) when you type a capital letter.
If it isn't to your liking, turn it off in settings.json
{
"[snowflake]": {
"editor.suggestOnTriggerCharacters":false,
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
}
}
}
Extension Settings
snowflake.linter.executablePath
: the location of snowflakefmt. Defaults to the devbox global install so only change if you are making updates to snowflakefmt