Use the SQL Editor
Tasks in the SQL Editor: create an SQL workspace, run queries, export results, add table mappings, reuse shared code, and save queries as a transformation.
This page has the step-by-step tasks in the SQL Editor, from the first workspace to a saved transformation. Each task after the first starts with the SQL Editor open on your workspace: in the workspace detail, click Open SQL Editor. The SQL Editor page explains the panes, sessions and workspace sharing.
Create an SQL workspace and open the editor
Section titled “Create an SQL workspace and open the editor”Goal: an SQL workspace with the SQL Editor open on it.
The SQL Editor is accessed via a dedicated SQL workspace. To get started, you must first create this workspace. For the other workspace types, see Create a workspace and load data.
-
Navigate to Workspaces from the main navigation menu.
-
Click + Create Workspace.
-
Select Snowflake SQL Workspace or Google BigQuery Workspace, depending on your project’s backend.
-
In the configuration dialog, provide a Name for your workspace (e.g., “Demo”). You can optionally add a description and select the Backend Size (Snowflake only).
-
Click CREATE WORKSPACE.

The workspace will be scheduled and created. Once active, you can access the SQL Editor.
-
Click on the newly created workspace to view its details.
-
Click OPEN SQL EDITOR.

Result: the SQL Editor opens on the new workspace.
Preview a table
Section titled “Preview a table”Goal: the first rows of a table, without writing a query.
To quickly inspect the contents of a table in the Storage Explorer:
-
Click the three dots next to the desired table (e.g.,
account). -
Select Data preview.

Result: this executes a SELECT * FROM table_name LIMIT 100 query, showing the first rows and metadata in the results pane below.

Run a query
Section titled “Run a query”Goal: your SQL run against the tables in the workspace, with the result in the pane below the code block.
-
Insert the table name. Instead of manually typing full table names, you can insert the fully qualified name directly into the editor: click the three dots next to the table name and select Place name in editor.

The editor automatically populates the code block with the table’s fully qualified identifier. The exact format depends on your backend; the example below shows Snowflake.
SELECT * FROM "SAPI_10495"."in.c-keboola-ex-http-01k749e8rrzzs9s7f9p7gbrg"."account"; -
Run the query. You can run a query either by clicking the green run icon next to the code block or using the keyboard shortcut Ctrl + Enter.

-
To work with multiple queries, add code blocks using the + New Query button below the existing block, or + New Code Block below the main editor section.

Result: the query result appears in the results pane. After executing a query, you can access detailed information about the execution in the results pane by clicking QUERY DETAILS.

After executing a query, you can view detailed information about previously run queries in the results pane by clicking QUERY HISTORY.
Reuse shared code
Section titled “Reuse shared code”Goal: a predefined query from Shared Code in your code block, either copied or linked.
Shared Code allows you to reuse predefined SQL queries across multiple transformations or query blocks. This promotes consistency and simplifies maintenance.
The shared code must exist already. To create it, see Shared Code.
-
In the SQL code editor block, click the Select Shared Code link.

-
In the “Add Shared Code” dialog, select the desired code from the dropdown (e.g.,
Aggregate).
-
Pick one of the two options for using shared code:
- Use Inline: The SQL text of the shared code is copied directly into your transformation block. You can then freely edit and modify the code locally. This is equivalent to copy-pasting the code.
- Use as Shared Code (Linking): The code block is linked to the original shared code template.
Result: the shared code is in your block. When linking shared code:
- The code block appears labeled SHARED CODE.
- Any updates made to the original shared code template will automatically propagate to this transformation block.
- The code within the block is read-only (uneditable), ensuring integrity with the shared template.
If you need to make modifications to the code for a specific transformation, you must use the Use Inline option.
Export a query result
Section titled “Export a query result”Goal: a query result downloaded as a CSV file.
- Click Run.
- In the results panel toolbar, click Export Results and choose a format:
- Export as CSV: standard comma-separated values
- Export as CSV (Gzip): compressed CSV for large exports
Result: your query results are downloaded as a CSV-formatted file.
Download limit: Exported files are limited to 100 MB. If your query result exceeds this size, consider adding a LIMIT clause to reduce the row count, filtering the data before export, or using Keboola Storage to access the full dataset.
Load filtered tables with input mapping
Section titled “Load filtered tables with input mapping”Goal: a Storage table loaded into the workspace with a column selection or a filter, the way a transformation would load it.
While the SQL Editor automatically provides read-only access to all tables within the project’s Storage (visible in the Storage Explorer below the Working Tables section), Input Mapping (IM) is necessary when you need to apply filters, specify specific columns, or set time-based filters before the data is loaded into the workspace database.
Input Mapping is also commonly used when migrating older transformations that rely on input mapping configuration.
-
Locate the desired table in the Storage Explorer (e.g., the
accounttable underbasic-customer). -
Click the three dots next to the table name.
-
Select Add table to Input Mapping.

-
The Input Mapping configuration dialog opens:

Here you can define:
-
Source: The source bucket and table (pre-filled).
-
Table Name: The alias used for this table in your SQL queries within the workspace (e.g.,
account). -
Columns (optional): Specify which columns to import, or leave empty to import all.
-
Changed in Last (optional): Filter the data based on when it was last changed in Storage. This is useful for incremental loads.

-
Data Filter (optional): Apply column-based filtering using specific values.
-
Data Types: Define column data types (optional).
-
-
Click Add Input to finalize the configuration. The table now appears in the Working Tables section marked with IM (Input Mapping).
When a table is configured with Input Mapping, it is not immediately loaded into the workspace. The configuration merely tells the transformation what to load when it runs.
To query and work with the filtered/mapped data interactively in the editor, you must manually load it:
-
In the Working Tables section, locate the Input Mapped table (e.g.,
account). -
Click the Load Data option that appears near the table.

-
Confirm the loading by clicking Load Latest Data.
The Clean workspace before loading option removes tables and views from the workspace schema but keeps stored procedures and user-defined functions. See Clean workspace before loading.
Result: the mapped table is loaded and you can query it. If a table is configured for Input Mapping but not yet loaded, hovering over the table icon will show a warning indicating limited functionality.

Save results to Storage with output mapping
Section titled “Save results to Storage with output mapping”Goal: a table you created in the workspace mapped to a table in Storage, ready to be saved as a transformation.
The SQL Editor supports creating persistent tables that are saved back into Keboola Storage.
To create a persistent table, you must convert your SELECT statements into CREATE TABLE AS SELECT statements, specifying a temporary output table name. These tables are automatically created in the workspace schema upon successful execution.
-
Define a new table with a
CREATE TABLE … AS SELECTstatement. Insert the source table name with Place name in editor. On Snowflake:CREATE TABLE "out" AS SELECT * FROM "<database>"."<bucket>"."<table>";On BigQuery, quote names with backticks:
CREATE TABLE `out` AS SELECT * FROM `<dataset>`.`<table>`;
-
Run the query block. If successful, the new tables (e.g.,
outandout2) will appear in the Working Tables section.
Once temporary working tables are created, you must map them to a destination in Keboola Storage if you want to create a transformation that saves data permanently.
-
In the Working Tables section, click the three dots next to the temporary table (e.g.,
out). -
Select Add table to Output Mapping.

-
In the Output Mapping dialog, configure the destination bucket and table name in Storage. You can also define the primary key and set incremental loading options.
-
Click ADD OUTPUT.
Result: once mapped, the table icon in the Working Tables section changes to OM (Output Mapping), confirming it is ready to be saved as a transformation.

Write directly to Storage (Direct Mode)
Section titled “Write directly to Storage (Direct Mode)”Goal: a Storage table the workspace writes to directly, with no copy step.
Direct Mode output mapping is a private beta: Keboola Support must enable it for your project, as the mappings page says.
On Snowflake and BigQuery workspaces, you can skip the copy step altogether and let the workspace write straight into a Storage table using Direct Mode output mapping.
- In the Working Tables section, click the three dots next to a working table and select Create writable table.
- Set the destination bucket and table name in Storage, and adjust the column definitions and the primary key.
- Click CREATE WRITABLE TABLE.
Result: Keboola creates the Storage table (creating the bucket first if it does not exist yet) and registers it as a Direct Mode output mapping, which grants the workspace write access to that table. The working table you started from is used only as the template for the column structure — it is not copied or modified.
The new table shows up in the Writable tables section of the Storage Explorer with the DG badge, and you
can INSERT, UPDATE, DELETE, or TRUNCATE it from your next query. Use the three-dots menu there to remove
the mapping, which also revokes the workspace’s write access.
Save queries as a transformation
Section titled “Save queries as a transformation”Goal: your queries saved in the workspace, then turned into a transformation with the workspace’s mappings.
-
Click SAVE QUERIES in the top right corner.

-
To add a note to the version, open the arrow next to the button and select Save with description instead.
-
Close the editor and, in the workspace detail, click Create new transformation, or Copy to existing transformation to update one you have. See Create a transformation from a workspace.
Result: a transformation with your saved queries, the input and output mapping and the variables of the workspace.
Next: Keboola JDBC driver →
Was this page helpful?
Thank you for helping improve Keboola's documentation!