RBENREJEB@RBR-OS:/OPT/DATAFORM-INTELLIJ-PLUGIN/FEATURES/SQLX-EDITING$ CAT README
FEATURES
SQLX editing
Google Cloud Dataform Plugin for IntelliJ · Features
The plugin understands the three parts of a SQLX file: the config { } block, js { } blocks and the
BigQuery SQL query, with its ${...} template expressions. It also injects BigQuery SQL in the query
template literals of .js and .ts definition files.
Editor toolbar
Each SQLX file opens with a toolbar above the editor:
- on the left, Compile compiles the Dataform project, Run query runs the compiled query in BigQuery (see Query execution) and Run action runs the file’s action as a Dataform workflow (see Workflow runs). In a unit test file they become Run test query and Run test;
- on the right, Editor only, Editor and preview and Preview only set the split layout, and Query, Schema and Lineage switch the compiled preview. Unit test files show a Test view instead.
Highlighting and validation
- Syntax highlighting for SQL, JavaScript and config blocks.
- BigQuery SQL dialect, with syntax validation and error highlighting.
- Schema-based validation of
workflow_settings.yamlandconfig { }blocks. - Dataform compilation and BigQuery dry-run errors shown on the tokens they refer to. See Errors and build.
Completion
Ctrl+Space completes:
- Dataform functions:
ref(),declare(),publish(),resolve(),self(), …; - the actions declared in the project, inside
ref(), in SQLX and JavaScript files, with their full table name and their type (table, incremental, view, …); config { }keys andworkflow_settings.yamlproperties;- JavaScript and TypeScript symbols, including your
includes/; - the columns of the tables produced by your project, with qualified names, their BigQuery type and
nested
STRUCT/RECORDfields. Schemas come from BigQuery dry runs of the compiled queries.
Typing $ opens completion for a ${...} expression.
Config block
In a config { } block, the keys and values offered follow the action’s type and the
@dataform/core version of the project:
- only the keys of that action type are offered. Completing a key inserts a skeleton matching what it expects, or moves the caret to its value when the key is already set;
- enumerated values are offered, as well as the tags already used in the project, and the action’s own
columns in
columns,clusterBy,uniqueKeyandassertions; partitionByoffers the partitioning expressions the action’s columns allow, such asDATE(order_ts)orTIMESTAMP_TRUNC(order_ts, DAY)on a timestamp column.
Ctrl+Q on a key describes what it expects, and lists the action’s columns when the key names one.
Mistakes in the block are reported as you type; see
Errors and build.
Navigation
Ctrl+ClickorCtrl+Bon aref()jumps to the referenced action, on an include to its file, and on a symbol to its declaration.Ctrl+Clickon a column opens the column window: where the column is declared and every query that reads it. See Column refactoring.DECLAREvariables of pre-operations resolve inside the query.
Quick Documentation
Ctrl+Q shows:
- for a table or
ref(): the target action, its type, schema and columns; - for a column: its name, type, mode, description and the table it comes from;
- for a BigQuery function: its signature, description and examples.
Inline expression values
Template expressions are folded to their evaluated value, the way IntelliJ IDEA shows the values of
.properties keys: FROM ${ref("users")} reads as FROM my-project.my_dataset.users.
workflow_settings.yamlreferences, such asdataform.projectConfig.vars.env, andincludes/exports are folded too.- Long or multi-line values are painted over several lines, in place.
- Hover a fold, or press
Ctrl+Q, to see the expression and its full value. Click a fold to edit the expression. - Only expressions with a single deterministic value are folded. Expressions that depend on the run
mode (
when(),incremental()) or define actions (publish(),operate(),assert(),declare()) stay visible.
Values are computed by running the expression with the project’s Node.js, so ref() and self()
resolve after a compilation. The feature can be turned off in the
plugin settings.