fcakyon/claude-codex-settings / plugins/cloudflare-skills/skills/basin
basin
VerifiedBuild and troubleshoot Cloudflare Basin analytics workflows with Basin Pipelines, Basin Catalog, and Basin SQL. Use for streaming data into R2 Iceberg tables, managing catalogs, or querying those tables; also use for requests using the former Data Platform, Pipelines, R2 Data Catalog, or R2 SQL names.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 2.9 KB |
| references/catalog/README.md | markdown | 1.2 KB |
| references/catalog/api.md | markdown | 3.3 KB |
| references/catalog/configuration.md | markdown | 2.1 KB |
| references/catalog/gotchas.md | markdown | 2.2 KB |
| references/catalog/patterns.md | markdown | 1.7 KB |
| references/pipelines/README.md | markdown | 4.5 KB |
| references/pipelines/api.md | markdown | 5.0 KB |
| references/pipelines/configuration.md | markdown | 6.1 KB |
| references/pipelines/gotchas.md | markdown | 3.0 KB |
| references/pipelines/patterns.md | markdown | 4.6 KB |
| references/skill-feedback.md | markdown | 2.7 KB |
| references/sql/README.md | markdown | 3.4 KB |
| references/sql/api.md | markdown | 4.8 KB |
| references/sql/configuration.md | markdown | 1.7 KB |
| references/sql/gotchas.md | markdown | 2.0 KB |
| references/sql/patterns.md | markdown | 4.3 KB |
references/sql/README.md
View on GitHub# Basin SQL
Serverless, distributed, **read-only** query engine (Apache DataFusion) for Apache Iceberg tables in Basin Catalog.
## Documentation
For full function lists, data types, and pricing, **retrieve the live docs** — use the Cloudflare MCP `docs` tool if available, otherwise `webfetch`.
| Topic | URL |
|-------|-----|
| Overview / get started | `https://developers.cloudflare.com/basin-sql/get-started/index.md` |
| Query data | `https://developers.cloudflare.com/basin-sql/query-data/index.md` |
| SQL reference | `https://developers.cloudflare.com/basin-sql/sql-reference/index.md` |
| Aggregate functions | `https://developers.cloudflare.com/basin-sql/sql-reference/aggregate-functions/index.md` |
| Scalar functions | `https://developers.cloudflare.com/basin-sql/sql-reference/scalar-functions/index.md` |
| Complex types | `https://developers.cloudflare.com/basin-sql/sql-reference/complex-types/index.md` |
| Limitations & best practices | `https://developers.cloudflare.com/basin-sql/reference/limitations-best-practices/index.md` |
| Wrangler commands | `https://developers.cloudflare.com/basin-sql/reference/wrangler-commands/index.md` |
| Pricing | `https://developers.cloudflare.com/basin-sql/platform/pricing/index.md` |
## Connection Values
| Value | Format |
|-------|--------|
| REST endpoint | `https://api.sql.cloudflarestorage.com/api/v1/accounts/{ACCOUNT_ID}/basin-sql/query/{BUCKET}` |
| Wrangler | `npx wrangler basin sql query "{WAREHOUSE}" "<SQL>"` with `WRANGLER_BASIN_SQL_AUTH_TOKEN` set |
| Warehouse | `{ACCOUNT_ID}_{BUCKET}` |
> The REST endpoint is `api.sql.cloudflarestorage.com` — **not** the account API host. The legacy `/r2-sql/query/` path may still work, but use `/basin-sql/query/` for new integrations.
## Quick Start
```bash
npx wrangler basin catalog enable my-bucket # 1. enable catalog
export WRANGLER_BASIN_SQL_AUTH_TOKEN=<r2-token> # 2. auth (Admin R&W + Basin SQL Read)
npx wrangler basin sql query "$ACCOUNT_ID"_my-bucket \
"SELECT * FROM default.my_table LIMIT 10" # 3. query
```
## SQL Surface
Basin SQL is read-only and supports a broad analytical SQL surface (SELECT, JOINs, subqueries, CTEs, set operations, window functions, and aggregate/scalar/JSON functions over complex types). For the authoritative, current list of supported syntax, functions, and limitations, see the SQL reference and limitations docs linked above. [api.md](api.md) has query templates.
## When to Use
**Use for:** SQL analytics over Iceberg (logs, BI, fraud, ad-hoc), multi-cloud queries without egress, dashboards (query from a Worker via HTTP).
**Don't use for:** writes (use PySpark/PyIceberg) or real-time OLTP (<100 ms).
## No Workers Binding
There is no `env.R2_SQL` binding. Query from a Worker via `fetch()` to the REST endpoint with the token as a secret (see [patterns.md](patterns.md#dashboard-worker)).
## Reading Order
1. [configuration.md](configuration.md) — enable catalog, tokens, env setup
2. [api.md](api.md) — SQL syntax templates, JOIN/window examples, response format, data types
3. [patterns.md](patterns.md) — CLI/REST/Worker queries, use cases, pagination, performance
4. [gotchas.md](gotchas.md) — what works vs. not, performance, troubleshooting
## See Also
- [Basin Catalog](../catalog/) — PyIceberg/PySpark, table management
- [Basin Pipelines](../pipelines/) — streaming ingest into queryable tables
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 319k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |