From airlayer
Compiles semantic queries to SQL using the airlayer CLI. Useful for generating SQL from .view.yml schemas, inspecting dimensions/measures/filters, and testing queries against a semantic layer.
How this skill is triggered — by the user, by Claude, or both
Slash command
/airlayer:query [--dimension view.dim --measure view.measure --filter view.dim:operator:value][--dimension view.dim --measure view.measure --filter view.dim:operator:value]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are compiling a semantic layer query to SQL using the `airlayer` CLI.
You are compiling a semantic layer query to SQL using the airlayer CLI.
Ensure airlayer is installed:
which airlayer || cargo install --git https://github.com/oxy-hq/airlayer
.view.yml files in the project. They are typically under a views/ or semantics/views/ directory.views/).find . -name "*.view.yml" -not -path "*/node_modules/*" -not -path "*/cube/*" 2>/dev/null | head -20
Before building a query, inspect what's available:
airlayer inspect```
This lists all views, dimensions, measures, and entities.
## Build and run the query
Use CLI flags (preferred for LLM tool use):
```bash
airlayer query -d <dialect> \
--dimension <view.dimension> \
--measure <view.measure> \
--filter <view.dimension>:<operator>:<value> \
--order <view.member>:desc \
--limit 100
Or JSON input for complex queries:
airlayer query -d <dialect> -q '{
"dimensions": ["view.dimension"],
"measures": ["view.measure"],
"filters": [{"member": "view.dim", "operator": "equals", "values": ["val"]}],
"order": [{"id": "view.measure", "desc": true}],
"limit": 100
}'
$ARGUMENTS
Pick the dialect based on the project's database:
postgres (default), mysql, bigquery, snowflake, duckdb, clickhouse, databricks, redshift, sqlite, domoIf the project has a config.yml with database definitions, use -c config.yml instead of -d.
equals, notEquals, contains, notContains, startsWith, notStartsWith, endsWith, notEndsWith, gt, gte, lt, lte, set, notSet, inDateRange, notInDateRange, beforeDate, beforeOrOnDate, afterDate, afterOrOnDate, onTheDate
--segments view.segment_name (predefined filter conditions)--through entity_name (disambiguate multi-path joins)"time_dimensions": [{"dimension": "view.date_col", "granularity": "month", "date_range": ["2024-01-01", "2024-12-31"]}]"date_range": ["last 7 days"] or ["this month"]"ungrouped": true for raw rows without aggregationairlayer prints the generated SQL to stdout and params to stderr. Show the SQL to the user.
npx claudepluginhub oxy-hq/airlayer --plugin airlayerAnswers business questions on analytics, metrics, KPIs by generating/executing SQL via dbt Semantic Layer, compiled SQL mods, or model analysis against data warehouse.
Lists views, dimensions, measures, and entities from .view.yml files using the airlayer CLI. Use to explore semantic layer schema before building queries.
Generates SQL queries from natural language for PostgreSQL, MySQL, BigQuery, Snowflake. Reads schemas from diagrams/docs for reports, exploration, business queries.