ashish10alex / vscode-dataform-tools

Dataform tools - a vscode extension
https://marketplace.visualstudio.com/items?itemName=ashishalex.dataform-lsp-vscode
MIT License
20 stars 4 forks source link
bigquery data-engineering dataform gcp vscode vscode-extension

Dataform tools - a vscode extension

Version Installs Linux macOS Windows

"Buy Me A Coffee"

⚠️ This is not an officially supported Google product.

VS Code extension for Dataform with following features

Feature Description
Compiled Query & Dry run stats Compiled query in a vertical split
Dependancy graph Interative dependancy graph with external sources higlighted in distinct colors
Inline diagnostics on .sqlx file Native lsp like experience with diagnostics being directly put on both the sqlx file & compiled query
Preview query results Preview query results in a table by running the file
Go to definition Go to definition for source in $ref{("my_source")} and javascript blocks in .sqlx files
Auto-completion - declarations in ${ref("..")} trigger when $ character is typed

- Dependencies when " or ' is typed inside the config block which has dependencies keyword is in the line prefix

- tags when " or ' is typed inside the config block which has tags keyword is in the line prefix
Code actions Apply dry run suggestions at the speed of thought
Run file(s)/tag(s) Run file(s)/tag(s), optionally with dependencies/dependents/full refresh using vscode command pallet / menu icons
Format using Sqlfluff 🪄 Fromat .sqlx files using sqlfluff
BigQuery snippets Code snippets for generic BigQuery functions taken from vscode-langauge-sql-bigquery extension

Requirements

  1. Dataform cli

    npm i -g @dataform/cli

    Run dataform compile from the root of your Dataform project to ensure that you are able to use the cli

  2. Setup default application credentials for GCP

  3. To enable formatting using sqlfluff install sqlfluff

    # install python and run
    pip install sqlfluff
  4. To enable prettier diagnostics install Error Lens extension [ optional ]

[!NOTE] Trouble installing ? Please see FAQ section, if you are still stuck, please raise an issue here

Features

Compiled query & Dry run stats

compilation

Dependency graph

depgraph

Inline diagnostics errors on .sqlx files ❗

diagnostics

Preview query results

preview_query_results

Go to definition

Go to definition for source in $ref{("my_source")}. Takes you to my_source.sqlx or sources.js at the line where my_source is defined. There is also support for go to definiton from a javascript variable/module from a .sqlx file to js block or .js file where the virable or module declaration exsists

go-to-definition

Autocomplete model, tags, dependencies

Auto completion support for dependencies when " or ' is typed inside the config block which has dependencies keyword is in the line prefix

auto-completion

Declarations in ${ref("..")} trigger when $ character is typed

auto-completion

Auto completion support for tags when " or ' is typed inside the config block which has tags keyword is in the line prefix

auto-completion

Formatting using sqlfluff

formatting

Run file/tag with dependencies/dependents

Open vscode command pallet by pressing CTLR + SHIFT + p or CMD + SHIFT + p on mac and run one of the required commands

Commands
Dataform: Run current file
Dataform: Run current file with dependencies
Dataform: Run current file with dependents
Dataform: Run current tag
Dataform: Run current tag with dependencies
Dataform: Run current tag with dependents
Dataform: Format current file
Dataform: Run file(s) / tag(s) with options

Known Issues

TODO