query
Compile a semantic query to SQL using airlayer. Use when the user wants to generate SQL from .view.yml schemas, test a query against their semantic layer, or…
от oxy-hq★ 32 звезды на GitHub
Установить query в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
airlayer Query — Compile Semantic Queries to SQL
You are compiling a semantic layer query to SQL using the airlayer CLI.
Prerequisites
Ensure airlayer is installed:
which airlayer || cargo install --git https://github.com/oxy-hq/airlayer
Locate the semantic layer
- Find
.view.ymlfiles in the project. They are typically under aviews/orsemantics/views/directory. - Identify the base directory (parent of
views/).
find . -name "*.view.yml" -not -path "*/node_modules/*" -not -path "*/cube/*" 2>/dev/null | head -20
Inspect available members
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 from user
$ARGUMENTS
Dialect selection
Pick the dialect based on the project's database:
postgres(default),mysql,bigquery,snowflake,duckdb,clickhouse,databricks,redshift,sqlite,domo
If the project has a config.yml with database definitions, use -c config.yml instead of -d.
Filter operators
equals, notEquals, contains, notContains, startsWith, notStartsWith, endsWith, notEndsWith, gt, gte, lt, lte, set, notSet, inDateRange, notInDateRange, beforeDate, beforeOrOnDate, afterDate, afterOrOnDate, onTheDate
Advanced features
- Segments:
--segments view.segment_name(predefined filter conditions) - Join hints:
--through entity_name(disambiguate multi-path joins) - Time dimensions (JSON only):
"time_dimensions": [{"dimension": "view.date_col", "granularity": "month", "date_range": ["2024-01-01", "2024-12-31"]}] - Relative dates (JSON only):
"date_range": ["last 7 days"]or["this month"] - Ungrouped mode (JSON only):
"ungrouped": truefor raw rows without aggregation
Output
airlayer prints the generated SQL to stdout and params to stderr. Show the SQL to the user.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
Bash - 02
Read - 03
Glob - 04
Grep
FAQ
Что делает скилл query?
Compile a semantic query to SQL using airlayer. Use when the user wants to generate SQL from .view.yml schemas, test a query against their semantic layer, or translate dimensions/measures/filters into dialect-specific SQL.
Как установить скилл query?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл query запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…