Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.93 KB

README.md

File metadata and controls

41 lines (30 loc) · 1.93 KB

vscode-dbt README

Provides snippets for dbt-flavoured SQL in VSCode

Features

Generic Jinja

for loops, conditionals, blocks, variable settings etc. See source for a full list jinja

dbt-flavoured SQL

ref, source, log, config etc. See source for a full list. dbt_sql

Requirements

  • 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 language jinja-sql which is implemented in this extention
  • Once you have installed the Better Jinja extension you may want to associate your .sql files with the jinja-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 with jinja-sql (optional but recommended) language add the following to your settings.json file:
   "files.associations":{
      "*.sql":"jinja-sql",
   }

Installation

The package is currently not hosted on the VSCode Extension Marketplace. To install it:

  1. Download the package from here
  2. Unzip it into ~/.vscode/extensions (or copy it somewhere and move it there).
  3. Restart VSCode for your changes to take effect.

Credits

dbt jinja concepts

adapted from https://github.com/fishtown-analytics/atom-dbt/blob/master/snippets/dbt-sql.cson

Jinja Concepts

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

Release Notes