Access the dbt Insights interface previewEnterpriseEnterprise +
Learn how to access Insights, run queries, and view results.
Insights provides a rich console experience with editor navigation. You can expect Insights to:
- Enable you to write SQL queries, with the option to open multiple tabs
- Have SQL + dbt autocomplete suggestions and syntax highlighting
- Bookmark SQL queries
- View the results of the query and its details using the Results or Details tabs
- Create a visualization of your query results using the Chart tab
- View the history of queries and their statuses (like Success, Error, Pending) using the Query history tab
- Use Copilot to generate or edit SQL queries using natural language prompts
- Integrate with Copilot, Catalog, Studio IDE, and Canvas to provide a seamless experience for data exploration, AI-assisted writing, and collaboration
Access the dbt Insights interface
Before accessing Insights, ensure that the prerequisites are met.
- To access Insights, select the Insights option in the navigation sidebar.
- If your developer credentials aren’t set up, Insights will prompt you to set them up. The ability to query data is subject to warehouse provider permissions according to your developer credentials.
- Once your credentials are set up, you can write, run, and edit SQL queries in the Insights editor for existing models in your project.
Run queries
To run queries in Insights, you can use:
- Standard SQL
- Jinja (
ref
,source
functions, and other Jinja functions) - Links from SQL code
ref
to the corresponding Explorer page - CTEs and subqueries
- Basic aggregations and joins
- Semantic Layer queries using Semantic Layer Jinja functions
Example
Let's use an example to illustrate how to run queries in Insights:
- A Jaffle Shop location wants to count unique orders and unique customers to understand whether they can expand their awesome Jaffle shop business to other parts of the world.
- To express this logic in SQL, you (an analyst assigned to this project) want to understand yearly trends to help guide expansion decisions. Write the following SQL query to calculate the number of unique customers, cities, and total order revenue:
with
orders as (
select * from {{ ref('orders') }}
),
customers as (
select * from {{ ref('customers') }}
)
select
date_trunc('year', ordered_at) as order_year,
count(distinct orders.customer_id) as unique_customers,
count(distinct orders.location_id) as unique_cities,
to_char(sum(orders.order_total), '999,999,999.00') as total_order_revenue
from orders
join customers
on orders.customer_id = customers.customer_id
group by 1
order by 1
Use dbt Copilot
To make things easier, use Copilot to save time and explore other ways to analyze the data. Copilot can help you quickly update the query or generate a new one based on your prompt.
- Click the Copilot icon in the Query console sidebar to open the prompt box.
- Enter your prompt in natural language and ask for a yearly breakdown of unique customers and total revenue. Then click Submit.
- Copilot responds with:
- A summary of the query
- An explanation of the logic
- The SQL it generated
- Options to Add or Replace the existing query with the generated SQL
- Review the output and click Replace to use the Copilot-generated SQL in your editor.
- Then, click Run to preview the results.
From here, you can:
- Continue building or modifying the query using Copilot
- Explore the results in the Results tab
- View metadata and query details in the Details tab
- Visualize results in the Chart tab
- Check the Query history for status and past runs
- Use Catalog to explore model lineage and context
- If you want to save the query, you can click Bookmark in the query console menu to save it for future reference.
You can access the Studio IDE or Canvas from the Query console menu to promote your SQL into a reusable dbt model — all within dbt!
View results
Using the same example, you can perform some exploratory data analysis by running the query and:
- Viewing results in Results tab — View the paginated results of the query.
- Sorting results — Click on the column header to sort the results by that column.
- Exporting to CSV — On the top right of the table, click the download button to export the dataset.
View details
View the details of the query by clicking on the Details tab:
- Query metadata — Copilot-generated title and description, the supplied SQL, and corresponding compiled SQL.
- Connection details — Relevant data platform connection information.
- Query details — Query duration, status, column count, row count.
Chart results
Visualize the chart results of the query by clicking on the Chart tab to:
- Select the chart type using the chart icon.
- Choose from line chart, bar chart, or scatterplot.
- Select the axis and columns to visualize using the Chart settings icon.
Query history
View the history of queries and their statuses (All, Success, Error, or Pending) using the Query history icon:
- Select a query to re-run to view the results.
- Search for past queries and filter by status.
- Hover over the query to view the SQL code or copy it.
The query history is stored indefinitely.
Use dbt Explorer
Access Catalog directly in Insights to view project resources such as models, columns, metrics, and dimensions, and more — all integrated in the Insights interface.
This integrated view allows you and your users to maintain your query workflow, while getting more context on models, semantic models, metrics, macros, and more. The integrated Catalog view comes with:
- Same search capabilities as Catalog
- Allows users to narrow down displayed objects by type
- Hyperlink from SQL code
ref
to the corresponding Explorer page - View assets in more detail by opening with the full Catalog experience or open them in Copilot.
To access Catalog, click on the Catalog icon in the Query console sidebar menu.
Set Jinja context
Bookmark your queries
Insights offers a robust bookmark feature for quickly finding the queries you use most. There's also an option to share bookmarks with other dbt users (and have them share with you). Click the bookmark icon in a query to add it to your list!
-
Click the bookmark icon on the right menu to manage your bookmarked queries. You can view your personal and shared queries
-
View bookmark details including description and creation date in the Overview tab.
-
View the bookmarks history in the Version history tab. Click a version to compare it the current and view changes.
Considerations
- Insights uses your development credentials to query. You have the ability to query against any object in your data warehouse that is accessible using your development credentials.
- Every Jinja function uses
defer --favor-state
to resolve Jinja. - Coming soon: The ability to select the environment you use to resolve your
refs
.
FAQs
- What’s the difference between Insights and Catalog?
- That’s a great question! Catalog helps you understand your dbt project's structure, resources, lineage, and metrics, offering context for your data.
- Insights builds on that context, allowing you to write, run, and iterate on SQL queries directly in dbt. It’s designed for ad-hoc or exploratory analysis and empowers business users and analysts to explore data, ask questions, and collaborate seamlessly.
- Catalog provides the context, while Insights enables action.