cockroachdb-sql

Generate CockroachDB-compatible SQL from natural language prompts.

3|3|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/cockroachdb/claude-plugin --skill cockroachdb-sql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cockroachdb-sql
Source: https://github.com/cockroachdb/claude-plugin/tree/main/skills/query-and-schema-design/cockroachdb-sql
Command: npx skills add https://github.com/cockroachdb/claude-plugin --skill cockroachdb-sql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

CockroachDB SQL guidance when you need to write, generate, or optimize SQL, design schemas, or reason about CockroachDB-specific patterns, type mappings, and best practices. It also helps avoid common anti-patterns like missing primary keys, hotspotting due to sequential IDs, or improper types.

Core Features & Use Cases

  • Converts natural language requests into CockroachDB-compliant SQL following CockroachDB best practices.
  • Provides guidance on schema design, DDL/DML generation, and optimization patterns for CockroachDB (e.g., UUID keys, LOCALITY patterns, AS OF SYSTEM TIME).
  • Use cases: writing queries, designing schemas, troubleshooting anti-patterns, understanding CockroachDB-specific typing and features.

Quick Start

Provide a CockroachDB-compatible SQL solution for the user's request, including table definitions, indexes, and example queries.

Frequently Asked Questions about cockroachdb-sql

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate CockroachDB SQL from natural language?

To generate CockroachDB SQL from natural language, provide a text prompt describing your desired schema or query to receive CockroachDB-compatible SQL statements following best practices like UUID primary keys and proper indexing.

What are the best practices for CockroachDB schema design?

CockroachDB schema design best practices include using UUID primary keys to avoid hotspotting from sequential IDs, selecting proper data types, and applying correct indexing patterns to optimize multi-region deployment performance.

Can I use natural language to optimize CockroachDB multi-region queries?

Yes, you can use natural language to optimize CockroachDB multi-region queries by requesting guidance on patterns like LOCALITY and AS OF SYSTEM TIME to improve regional read and write performance.

Why does CockroachDB recommend UUID primary keys over sequential IDs?

CockroachDB recommends UUID primary keys over sequential IDs because sequential IDs create hotspotting on a single range, whereas UUIDs distribute writes evenly across the cluster to maintain performance.

How do I validate CockroachDB SQL syntax and understand execution plans?

To validate CockroachDB SQL syntax and understand execution plans, connect the tool to your database; it validates syntax and explains execution plans, or provides guidance and example SQL when not connected.

What are common CockroachDB SQL anti-patterns to avoid?

Common CockroachDB SQL anti-patterns to avoid include missing primary keys, hotspotting caused by sequential IDs, and using improper data types that negatively impact multi-region performance and type mapping.