Skip to content

Code Editor

Editing files in Designer uses Code Editor. Code Editor is powered by the Monaco Editor, which also powers Visual Studio Code and other editors across the web.

Code Editor supports basic syntax colorization and works with the command palette in Designer.


Create files to edit

The following file types can be created within Designer and then edited in Code Editor:

  • .sql
  • .py

To create .sql or .py files:

  1. In the Files panel, click Add.
  2. Choose what file to create:
    1. Python script (.py)
    2. SQL script (.sql)

This will situate the newly created file outside any folders.

To create a file inside a folder, click ... alongside that folder and then click Add Python script (or other type of file).

Creating a new Python script or SQL script will open that new script in Code Editor.


Edit files

If the repository you have connected to a Data Productivity Cloud project contains any of the following files, you can edit them in Code Editor:

Note

We are working to add support for editing .json files.

Note

All the file types in this list can be imported to and exported from Designer.


Rename, move, and delete files

You can rename, move, and delete any files in your project.


Using variables in the code editor

Snowflake

Warning

When naming variables, avoid using Snowflake reserved keywords.

Applies to Note
Code written inside the SQL Script component. Supports both existing variable code ${variable} and Snowflake variable syntax.
Code written inside the SQL transformation component. Supports the existing variable code ${variable}.
Code written inside SQL script files. Only Snowflake variable syntax is supported.
Code written inside the Python Pushdown component or Python script files. Only Python variable syntax is supported.

Databricks

Warning

When naming variables, avoid using Databricks reserved keywords.

Applies to Note
Code written inside the SQL Script component. Supports both existing variable code ${variable} and Databricks variable syntax.
Code written inside the SQL transformation component. Supports the existing variable code ${variable}.
Code written inside SQL script files. Only Databricks variable syntax is supported.
Code written inside Python script files. Only Python variable syntax is supported.

Warning

The Python Pushdown component is not yet available for Databricks projects. You can use Code Editor to edit your .py files, but you cannot run these Python scripts from a Databricks project in Designer yet.

Amazon Redshift

Warning

When naming variables, avoid using Amazon Redshift reserved keywords.

Applies to Note
Code written inside the SQL Script component. Supports the existing variable code ${variable}.
Code written inside the SQL transformation component. Supports the existing variable code ${variable}.
Code written inside SQL script files. Variables not supported. Coming soon.
Code written inside Python script files. Only Python variable syntax is supported.

Warning

The Python Pushdown component is not yet available for Amazon Redshift projects. You can use Code Editor to edit your .py files, but you cannot run these Python scripts from an Amazon Redshift project in Designer yet.

However, you can use the Python Script component to run Python scripts from within that component's inline editor.


Command palette

Designer

Using the Designer command palette, press cmd + k (Mac) or CTRL + k (Windows) to activate the command palette in Designer. Type the name of the file you wish to open and then press Enter. Alternatively, activate the command palette by clicking the magnifying glass (search) in the top-left.

Monaco Editor

Using the Monaco Editor command palette, press fn + F1 (Mac) or F1 (Windows) to access all command palette actions available in Monaco Editor-powered editors.