# databricks-dbsql

Equips your coding agent with advanced Databricks SQL patterns, pipe syntax, H3 geospatial functions, and embedded LLM queries.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 364 installs · ★ 368
- Author: databricks
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/databricks/databricks-agent-skills/tree/HEAD/skills/databricks-dbsql/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/databricks-dbsql

## What it does

This skill supplies your assistant with patterns for advanced Databricks SQL (DBSQL) and SQL Warehouse environments. It covers procedural scripting with `BEGIN...END`, atomic transactions, recursive CTEs, and pipe syntax using the `|>` operator. It helps the agent write dialect-specific code without hallucinating standard SQL constructs.

It also details the setup for Lakehouse Federation queries, file ingestion with `read_files`, and native AI functions such as `ai_query` and `ai_classify`. In addition, reference patterns for H3 indexing and ST spatial functions are included.

Using this skill alongside Databricks tooling expects `databricks CLI` version 1.0.0 or higher. Certain capabilities like materialized views and `http_request` also demand Pro or Serverless SQL Warehouses.

## Requirements
- Works with: Databricks

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add databricks/databricks-agent-skills --skill databricks-dbsql -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/databricks-dbsql/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/databricks-dbsql/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add databricks/databricks-agent-skills --skill databricks-dbsql -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/databricks-dbsql/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add databricks/databricks-agent-skills --skill databricks-dbsql -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/databricks-dbsql/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install databricks/databricks-agent-skills databricks-dbsql
```

2. **Manually: put the files in place**
- File: `.github/skills/databricks-dbsql/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add databricks/databricks-agent-skills --skill databricks-dbsql -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/databricks/databricks-agent-skills --path skills/databricks-dbsql
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/databricks-dbsql/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add databricks/databricks-agent-skills --skill databricks-dbsql -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/databricks/databricks-agent-skills/tree/HEAD/skills/databricks-dbsql/SKILL.md

## When to use it
- write stored procedures with SQLEXCEPTION handlers in Databricks SQL
- enrich datasets directly using ai_query and ai_classify functions
- run geospatial proximity searches with H3 indexing and ST points
- refactor multi-step queries using DBSQL pipe operator syntax

## Example prompts
- Write a stored procedure in Databricks SQL to merge staging orders with error handling
- Show how to use ai_classify to categorize incoming support tickets in DBSQL
- Create an H3 geospatial query to calculate distances between coordinates

## Similar
- [sql-queries](https://affpapa.org/en/nevibecode/skills/sql-queries.md) — skill · 4500 installs
- [migrating-dbt-project-across-platforms](https://affpapa.org/en/nevibecode/skills/migrating-dbt-project-across-platforms.md) — skill · 526 installs
- [neon-ai-gateway](https://affpapa.org/en/nevibecode/skills/neon-ai-gateway.md) — skill · 27700 installs
- [fabric-lakehouse](https://affpapa.org/en/nevibecode/skills/fabric-lakehouse.md) — skill · 8800 installs
- [chief-data-officer-advisor](https://affpapa.org/en/nevibecode/skills/chief-data-officer-advisor.md) — skill · 410 installs
- [firebase-data-connect](https://affpapa.org/en/nevibecode/skills/firebase-data-connect.md) — skill · 168800 installs

From the same set: [databricks/databricks-agent-skills](https://affpapa.org/en/nevibecode/by/databricks/databricks-agent-skills.md) — 7 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
