Skip to content
Agentmart
Submit a tool

query

Compile a semantic query to SQL using airlayer.

Skill by oxy-hq

IndexedApache-2.0★ 31
Write a review

Chalk Labs

Need help deploying query?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/oxy-hq-query-a61c41

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

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.

Use cases: backend, testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/query

What's inside

Skill name
query
Description
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.
License
Apache-2.0
Instructions
82 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • allowed-tools: must be a space-separated string

Files (1)

  • SKILL.md

SKILL.md (first lines)

# 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:
```bash
which airlayer || cargo install --git https://github.com/oxy-hq/airlayer
```

## Locate the semantic layer

1. Find `.view.yml` files in the project. They are typically under a `views/` or `semantics/views/` directory.
2. Identify the base directory (parent of `views/`).

```bash
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:

```bash
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:

```bash
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": true` for raw rows without aggregation

## Output

airlayer prints the generated SQL to stdout and params to stderr. Show the SQL to the user.

From oxy-hq/airlayer, Apache-2.0.

Signals

Stars
31
Forks
5
Open issues
14
Last commit (this folder)
Apr 1, 2026 (7 months ago)
Last release
Sep 2, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from oxy-hq

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get query running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying query?

CallGet help
Cite this page

query skill. Agent Mart. https://agentmart.dev/skills/oxy-hq-query-a61c41 (last updated 2026-10-24)