⚠️ This is not an officially supported Google product.
VS Code extension for Dataform with following features
Feature | Description |
---|---|
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 |
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 |
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 |
Compilation & Dry run stats | - Live compiled query in a vertical split on save which is in sync with the current cursor position of your .sqlx file - Data processed by query on bottom right on successful dry run |
Run a specific file/tag | Run a file/tag, optionally with dependencies/dependents with vscode command pallet / menu icons |
Format using Sqlfluff 🪄 | Fromat .sqlx files using sqlfluff |
npm i -g @dataform/cli
To enable formatting using sqlfluff install sqlfluff
# install python and run
pip install sqlfluff
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
.sqlx
files ❗Auto completion support for dependencies
when "
or '
is typed inside the config block which has dependencies
keyword is in the line prefix
Declarations in ${ref("..")}
trigger when
Auto completion support for tags
when "
or '
is typed inside the config block which has tags
keyword is in the line prefix
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
Live compiled query in a vertical split on save which is in sync with the current cursor position of your sqlx file. Data processed by query on bottom right on successful dry run
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 |
[Unable to execute command e.g. error]() command vscode-dataform-tools.xxx not found
~/Documents/repos/my_dataform_project
ensure that workspace is opened at
~/Documents/repos/my_dataform_project
NOT ~/Documents/repos/my_dataform_project
dataform compile --json
command without infering the dataform root at run time[Error compiling Dataform, process existed with exit code 1]()
dataform --version
in your terminaldataform compile
on your terminal from the root of your dataform projectnpm i -g @dataform/cli@2.9.0
. Make sure you verify the version by running the dataform --version
[Dataform encountered an error: Missing credentials JSON file; not found at path
dataform init-creds
from the from the root of your dataform project in your terminaljson/adc
. Choosing adc will be use your default gcp credentials that you had setup using gcloud
[I do not want to see compiled query each time I save it]()
[I want the autocompletion to be of the format ${ref('dataset_name', 'table_name)}
instead of ${ref('table_name')}
]()
${ref("dataset", "table")}