wren-sql

Generate and validate Wren SQL queries for MDL semantic models, diagnosing dialect issues like BigQuery quirks.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/kubeworkz/legible --skill wren-sql-kubeworkz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wren-sql
Source: https://github.com/kubeworkz/legible/tree/main/wren-engine/skills/wren-sql
Command: npx skills add https://github.com/kubeworkz/legible --skill wren-sql-kubeworkz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Wren SQL works within the Wren Engine MDL semantic layer to generate, validate, and correct SQL queries that operate on MDL models rather than raw tables, reducing dialect drift and syntax errors.

Core Features & Use Cases

  • Generate MDL-compliant SQL targeting Wren Engine data sources.
  • Diagnose and repair common MDL, data type, and dialect issues (including BigQuery quirks).
  • Use cases include querying MDL models, filtering data, performing aggregations, and creating calculated fields with safe casting and deterministic results.

Quick Start

Start a session to generate a Wren SQL query for a given MDL model and fix any detected issues in the produced dialect SQL.

Frequently Asked Questions about wren-sql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write and validate SQL queries against MDL semantic models?

To write and validate SQL against MDL semantic models, you generate queries using the Wren Engine to ensure compliance with MDL rules, correct data types, and specific dialect quirks. This approach prevents dialect drift and syntax errors.

What is the best way to fix dialect-specific SQL errors when querying MDL models?

The best way to fix dialect-specific SQL errors when querying MDL models is to apply robust error diagnosis to identify the issue, then correct dialect or model issues directly to produce error-free dialect SQL.

Can I use Wren SQL to create calculated fields with safe casting in BigQuery?

Yes, you can use Wren SQL to create calculated fields with safe casting in BigQuery. It applies MDL rules and dialect-specific quirks to ensure deterministic results and error-free queries across your data sources.

Why does my SQL query fail when filtering or aggregating data in Wren Engine?

Your SQL query may fail when filtering or aggregating data in Wren Engine due to dialect drift or syntax errors. Diagnosing the query against MDL rules and data types helps correct model issues and ensures compliant queries.