Provides snippets for dbt-flavoured SQL in VSCode
for loops, conditionals, blocks, variable settings etc. See source for a full list
ref, source, log, config etc. See source for a full list.
- Syntax highlighting, and jinja comments
{# comment #}
formatting is extremely well implemented in the Better Jinja VSCode extemsion. You really should install it as this extension is meant to work for the languagejinja-sql
which is implemented in this extention - Once you have installed the Better Jinja extension you may want to associate your
.sql
files with thejinja-sql
language that you do not have to select it every time but this is entirely up to you and your use case. For example, you may in some cases not want to write dbt-/jinja-flavoured SQL. - To associate your
.sql
files withjinja-sql
(optional but recommended) language add the following to yoursettings.json
file:
"files.associations":{
"*.sql":"jinja-sql",
}
The package is currently not hosted on the VSCode Extension Marketplace. To install it:
- Download the package from here
- Unzip it into
~/.vscode/extensions
(or copy it somewhere and move it there). - Restart VSCode for your changes to take effect.
adapted from https://github.com/fishtown-analytics/atom-dbt/blob/master/snippets/dbt-sql.cson
adapted from https://github.com/danielchatfield/atom-jinja2/blob/master/snippets/atom-jinja2.cson and https://github.com/fishtown-analytics/atom-dbt/blob/master/snippets/dbt-jinja.cson