Skip to main content

What is Wren SQL?

Use this page to understand how Wren SQL appears in Wren AI answers and how it relates to the original SQL generated for your connected data source.

Important note

Wren SQL is specific to Wren AI. While it is based on standard SQL concepts, copying a Wren SQL query directly into another database may fail because the syntax can differ from your warehouse's native SQL dialect.

Wren SQL is the normalized SQL representation used inside Wren AI. It gives you a consistent way to inspect query logic across supported data sources, even when the final warehouse SQL differs by dialect.

Concepts

Result Wren SQL

The results area provides a detailed breakdown of the results, including the Wren SQL statement that was used. To view this click the “View Full SQL” button.

view_sql.gif

Original SQL

In addition to the Wren SQL representation, you can inspect the original SQL dialect used for your connected data source, such as BigQuery or MySQL. This option is available for projects that connect directly to an external data source.

show_original_sql

note

Clicking the button “Show original SQL” will translate from Wren SQL to the original SQL.

show_original_bq_sql

note

You can copy the original SQL statement by clicking Copy.

Why use Wren SQL?

  • Standardized syntax: Wren SQL gives you one consistent query format across supported data sources.
  • Easier review: It is often easier to read and compare than jumping between warehouse-specific dialects.
  • Better explainability: It helps teams inspect how Wren AI interpreted a question before or alongside the warehouse-native SQL.