Skip to main content
The SQL editor is where you write and test queries for your datasets. It includes autocomplete, preview results, and integrates directly with the AI assistant.

Editor layout

The dataset page is divided into panels:
  • Left panel — the catalog browser. Expand schemas, tables, and columns from your datasource. Toggle with Cmd+Left Arrow.
  • Center panel — the SQL editor where you write your query.
  • Bottom panel — preview results from your most recent run. Toggle with Cmd+J.

Writing a query

Start typing SQL and the editor will suggest table and column names from your datasource’s catalog. The autocomplete is aware of your database dialect (PostgreSQL, Snowflake, BigQuery, etc.).
SELECT
  date_trunc('month', created_at) AS month,
  COUNT(*) AS total_users
FROM users
GROUP BY month
ORDER BY month

Running a preview

Press Cmd+Enter (or click the Run button) to execute your draft query and see results in the bottom panel. Previews run with a row limit and timeout to keep them fast. The preview runs whatever is currently in the editor — you don’t need to save first.

Saving and publishing

Press Cmd+S to save. This:
  1. Stores the query as the dataset’s published query.
  2. Triggers a background run that materializes the full results.
  3. Updates any charts on boards that use this dataset.

Keyboard shortcuts

ActionShortcut
Run query (preview)Cmd+Enter
Save datasetCmd+S
Toggle left panelCmd+Left Arrow
Toggle bottom panelCmd+J
Open AI chatCmd+/