[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-cockroachdb-cockroachdb-sql":3,"mdc-lje5rt-key":36,"related-org-cockroachdb-cockroachdb-sql":730,"related-repo-cockroachdb-cockroachdb-sql":892},{"slug":4,"name":4,"fn":5,"description":6,"org":7,"tags":11,"stars":22,"repoUrl":23,"updatedAt":24,"license":25,"forks":26,"topics":27,"repo":31,"sourceUrl":34,"mdContent":35},"cockroachdb-sql","write and optimize CockroachDB SQL","Use when writing, generating, or optimizing SQL for CockroachDB, designing CockroachDB schemas, or when the user asks about CockroachDB-specific SQL patterns, type mappings, and distributed database best practices. Also use when encountering CockroachDB anti-patterns like missing primary keys, sequential ID hotspots, or incorrect type usage.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},"cockroachdb","CockroachDB","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Fcockroachdb.png",[12,16,19],{"name":13,"slug":14,"type":15},"Performance","performance","tag",{"name":17,"slug":18,"type":15},"Database","database",{"name":20,"slug":21,"type":15},"SQL","sql",3,"https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fclaude-plugin","2026-07-25T05:31:22.562808",null,2,[28,29,8,30],"claude","cockroach-cloud","developer-tools",{"repoUrl":23,"stars":22,"forks":26,"topics":32,"description":33},[28,29,8,30],"CockroachDB development plugin for Claude","https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fclaude-plugin\u002Ftree\u002FHEAD\u002Fskills\u002Fcockroachdb-query-and-schema-design\u002Fcockroachdb-sql","---\nname: cockroachdb-sql\ndescription: Use when writing, generating, or optimizing SQL for CockroachDB, designing CockroachDB schemas, or when the user asks about CockroachDB-specific SQL patterns, type mappings, and distributed database best practices. Also use when encountering CockroachDB anti-patterns like missing primary keys, sequential ID hotspots, or incorrect type usage.\ncompatibility: Can work with or without connection to a database. Without connection it generates the SQL and gives instruction for connection.With connection it requires appropriate privilege on target database and tables (SELECT, INSERT, UPDATE, DELETE, or admin).\nmetadata:\n  author: cockroachdb\n  version: \"1.0\"\n---\n\n## CockroachDB SQL Skill  \n\nConverts natural language questions into CockroachDB-compliant SQL queries, following CockroachDB best practices. Use it for schema design, writing queries and optimizing query.\n\n## How to Apply this Skill\n\n1. **Connection Detection** — already performed on skill invocation; reuse active connection.\n\n2. **Parse Natural Language Intent**\n   - Identify the operation type (SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, etc.)\n\n3. **Context Gathering**\n   - Check for existing schema context in conversation\n   - If connected to DB, query existing schema:\n     - `SHOW TABLES;` to see existing tables\n     - `SHOW CREATE TABLE table_name;` for existing structure\n   - Ask clarifying questions if needed:\n     - Table structure if not provided\n     - Data types for columns\n     - Index requirements\n     - Multi-region needs\n     - Performance characteristics\n\n4. **Apply CockroachDB Rules**\n   - Reference rules in `references\u002Fcockroachdb-rules\u002F` \n   - Ensure compliance with CockroachDB best practices\n   - **Determine rule category based on operation and apply the relavant rules**:\n     * `00-fundamental-principles.md` - Always apply these first\n     * `01-schema-design.md` - Table creation and structure\n     * `02-dml-operations.md` - Data modification\n     * `03-query-patterns.md` - Query construction\n     * `04-optimization.md` - Performance, Optimization and anti-patterns\n     * `05-operational.md` - Admin and maintenance\n   - Validate against anti-patterns in 04-optimization.md \n\n5. **Validate against DB(MANDATORY)**\n   - ALWAYS run EXPLAIN on every generated SQL query when connected to DB.\n   - If EXPLAIN returns a parsing\u002Fsyntax error, fix the query and re-run EXPLAIN until it passes.\n   - Include the EXPLAIN output in the response.\n\n## Response Behavior\n\n### Initial Response\n\nWhen skill is invoked:\n1. **Check for an available connection** so queries run against the right cluster:\n   - Check if a connection string is provided in the prompt (postgresql:\u002F\u002F...).\n     - If provided, use `cockroach sql --url \"\u003Cprovided-url>\" -e \"SQL\"` to run queries. Do not use psql.\n   - Else check the COCKROACH_URL environment variable (`echo $COCKROACH_URL`).\n     - If set, use `cockroach sql --url $COCKROACH_URL -e \"SQL\"` to run queries. Do not use psql.\n   - Else check for cockroach-cloud MCP server availability.\n   - If none of these are available or it is unclear which cluster to use, ask the user before running anything.\n\n2. Focus exclusively on CockroachDB\n3. Emphasize \"natural language to CockroachDB SQL\" not \"database conversion\"\n4. Present CockroachDB-specific syntax even when a rule derives from PostgreSQL compatibility.\n\n### Output Format\n- Show generated SQL with explanatory comments\n- List CockroachDB-specific features used\n- Include performance considerations\n- When optimizing, at each step 1- Explain the step's purpose. 2- Execute the step and report the outcome. 3- Summarize all findings and actions taken.\n- Provide references used including the rules\n\n## Examples\n\n### Schema Design — UUID Primary Key (Avoid Hotspots)\n\n```sql\nCREATE TABLE orders (\n  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n  customer_id UUID NOT NULL,\n  status STRING NOT NULL DEFAULT 'pending',\n  total DECIMAL(10,2) NOT NULL,\n  created_at TIMESTAMPTZ NOT NULL DEFAULT now(),\n  INDEX idx_orders_customer (customer_id),\n  INDEX idx_orders_status_created (status, created_at DESC)\n);\n```\n\n### Batch Upsert with UNNEST\n\n```sql\nUPSERT INTO inventory (sku, warehouse, quantity, updated_at)\nSELECT * FROM UNNEST(\n  ARRAY['SKU-001', 'SKU-002', 'SKU-003']::STRING[],\n  ARRAY['us-east', 'us-east', 'us-west']::STRING[],\n  ARRAY[100, 250, 75]::INT[],\n  ARRAY[now(), now(), now()]::TIMESTAMPTZ[]\n);\n```\n\n### Keyset Pagination (Avoid OFFSET)\n\nUse the previous page's last `(created_at, id)` as the cursor. In application code these are bound parameters; the literals here are placeholders.\n\n```sql\nSELECT id, customer_id, created_at\nFROM orders\nWHERE (created_at, id) > ('2025-01-01'::TIMESTAMPTZ, '00000000-0000-0000-0000-000000000000'::UUID)\nORDER BY created_at, id\nLIMIT 50;\n```\n\n## Supporting Documentation\n\n- `references\u002Fcockroachdb-rules\u002F` - CockroachDB SQL rules \n- `references\u002FEXAMPLES.md` - SQL examples and patterns\n",{"data":37,"body":41},{"name":4,"description":6,"compatibility":38,"metadata":39},"Can work with or without connection to a database. Without connection it generates the SQL and gives instruction for connection.With connection it requires appropriate privilege on target database and tables (SELECT, INSERT, UPDATE, DELETE, or admin).",{"author":8,"version":40},"1.0",{"type":42,"children":43},"root",[44,53,59,65,315,321,328,333,423,429,457,463,469,560,566,628,634,647,694,700,724],{"type":45,"tag":46,"props":47,"children":49},"element","h2",{"id":48},"cockroachdb-sql-skill",[50],{"type":51,"value":52},"text","CockroachDB SQL Skill",{"type":45,"tag":54,"props":55,"children":56},"p",{},[57],{"type":51,"value":58},"Converts natural language questions into CockroachDB-compliant SQL queries, following CockroachDB best practices. Use it for schema design, writing queries and optimizing query.",{"type":45,"tag":46,"props":60,"children":62},{"id":61},"how-to-apply-this-skill",[63],{"type":51,"value":64},"How to Apply this Skill",{"type":45,"tag":66,"props":67,"children":68},"ol",{},[69,81,98,178,289],{"type":45,"tag":70,"props":71,"children":72},"li",{},[73,79],{"type":45,"tag":74,"props":75,"children":76},"strong",{},[77],{"type":51,"value":78},"Connection Detection",{"type":51,"value":80}," — already performed on skill invocation; reuse active connection.",{"type":45,"tag":70,"props":82,"children":83},{},[84,89],{"type":45,"tag":74,"props":85,"children":86},{},[87],{"type":51,"value":88},"Parse Natural Language Intent",{"type":45,"tag":90,"props":91,"children":92},"ul",{},[93],{"type":45,"tag":70,"props":94,"children":95},{},[96],{"type":51,"value":97},"Identify the operation type (SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, etc.)",{"type":45,"tag":70,"props":99,"children":100},{},[101,106],{"type":45,"tag":74,"props":102,"children":103},{},[104],{"type":51,"value":105},"Context Gathering",{"type":45,"tag":90,"props":107,"children":108},{},[109,114,145],{"type":45,"tag":70,"props":110,"children":111},{},[112],{"type":51,"value":113},"Check for existing schema context in conversation",{"type":45,"tag":70,"props":115,"children":116},{},[117,119],{"type":51,"value":118},"If connected to DB, query existing schema:\n",{"type":45,"tag":90,"props":120,"children":121},{},[122,134],{"type":45,"tag":70,"props":123,"children":124},{},[125,132],{"type":45,"tag":126,"props":127,"children":129},"code",{"className":128},[],[130],{"type":51,"value":131},"SHOW TABLES;",{"type":51,"value":133}," to see existing tables",{"type":45,"tag":70,"props":135,"children":136},{},[137,143],{"type":45,"tag":126,"props":138,"children":140},{"className":139},[],[141],{"type":51,"value":142},"SHOW CREATE TABLE table_name;",{"type":51,"value":144}," for existing structure",{"type":45,"tag":70,"props":146,"children":147},{},[148,150],{"type":51,"value":149},"Ask clarifying questions if needed:\n",{"type":45,"tag":90,"props":151,"children":152},{},[153,158,163,168,173],{"type":45,"tag":70,"props":154,"children":155},{},[156],{"type":51,"value":157},"Table structure if not provided",{"type":45,"tag":70,"props":159,"children":160},{},[161],{"type":51,"value":162},"Data types for columns",{"type":45,"tag":70,"props":164,"children":165},{},[166],{"type":51,"value":167},"Index requirements",{"type":45,"tag":70,"props":169,"children":170},{},[171],{"type":51,"value":172},"Multi-region needs",{"type":45,"tag":70,"props":174,"children":175},{},[176],{"type":51,"value":177},"Performance characteristics",{"type":45,"tag":70,"props":179,"children":180},{},[181,186],{"type":45,"tag":74,"props":182,"children":183},{},[184],{"type":51,"value":185},"Apply CockroachDB Rules",{"type":45,"tag":90,"props":187,"children":188},{},[189,200,205,284],{"type":45,"tag":70,"props":190,"children":191},{},[192,194],{"type":51,"value":193},"Reference rules in ",{"type":45,"tag":126,"props":195,"children":197},{"className":196},[],[198],{"type":51,"value":199},"references\u002Fcockroachdb-rules\u002F",{"type":45,"tag":70,"props":201,"children":202},{},[203],{"type":51,"value":204},"Ensure compliance with CockroachDB best practices",{"type":45,"tag":70,"props":206,"children":207},{},[208,213,215],{"type":45,"tag":74,"props":209,"children":210},{},[211],{"type":51,"value":212},"Determine rule category based on operation and apply the relavant rules",{"type":51,"value":214},":\n",{"type":45,"tag":90,"props":216,"children":217},{},[218,229,240,251,262,273],{"type":45,"tag":70,"props":219,"children":220},{},[221,227],{"type":45,"tag":126,"props":222,"children":224},{"className":223},[],[225],{"type":51,"value":226},"00-fundamental-principles.md",{"type":51,"value":228}," - Always apply these first",{"type":45,"tag":70,"props":230,"children":231},{},[232,238],{"type":45,"tag":126,"props":233,"children":235},{"className":234},[],[236],{"type":51,"value":237},"01-schema-design.md",{"type":51,"value":239}," - Table creation and structure",{"type":45,"tag":70,"props":241,"children":242},{},[243,249],{"type":45,"tag":126,"props":244,"children":246},{"className":245},[],[247],{"type":51,"value":248},"02-dml-operations.md",{"type":51,"value":250}," - Data modification",{"type":45,"tag":70,"props":252,"children":253},{},[254,260],{"type":45,"tag":126,"props":255,"children":257},{"className":256},[],[258],{"type":51,"value":259},"03-query-patterns.md",{"type":51,"value":261}," - Query construction",{"type":45,"tag":70,"props":263,"children":264},{},[265,271],{"type":45,"tag":126,"props":266,"children":268},{"className":267},[],[269],{"type":51,"value":270},"04-optimization.md",{"type":51,"value":272}," - Performance, Optimization and anti-patterns",{"type":45,"tag":70,"props":274,"children":275},{},[276,282],{"type":45,"tag":126,"props":277,"children":279},{"className":278},[],[280],{"type":51,"value":281},"05-operational.md",{"type":51,"value":283}," - Admin and maintenance",{"type":45,"tag":70,"props":285,"children":286},{},[287],{"type":51,"value":288},"Validate against anti-patterns in 04-optimization.md",{"type":45,"tag":70,"props":290,"children":291},{},[292,297],{"type":45,"tag":74,"props":293,"children":294},{},[295],{"type":51,"value":296},"Validate against DB(MANDATORY)",{"type":45,"tag":90,"props":298,"children":299},{},[300,305,310],{"type":45,"tag":70,"props":301,"children":302},{},[303],{"type":51,"value":304},"ALWAYS run EXPLAIN on every generated SQL query when connected to DB.",{"type":45,"tag":70,"props":306,"children":307},{},[308],{"type":51,"value":309},"If EXPLAIN returns a parsing\u002Fsyntax error, fix the query and re-run EXPLAIN until it passes.",{"type":45,"tag":70,"props":311,"children":312},{},[313],{"type":51,"value":314},"Include the EXPLAIN output in the response.",{"type":45,"tag":46,"props":316,"children":318},{"id":317},"response-behavior",[319],{"type":51,"value":320},"Response Behavior",{"type":45,"tag":322,"props":323,"children":325},"h3",{"id":324},"initial-response",[326],{"type":51,"value":327},"Initial Response",{"type":45,"tag":54,"props":329,"children":330},{},[331],{"type":51,"value":332},"When skill is invoked:",{"type":45,"tag":66,"props":334,"children":335},{},[336,408,413,418],{"type":45,"tag":70,"props":337,"children":338},{},[339,344,346],{"type":45,"tag":74,"props":340,"children":341},{},[342],{"type":51,"value":343},"Check for an available connection",{"type":51,"value":345}," so queries run against the right cluster:",{"type":45,"tag":90,"props":347,"children":348},{},[349,370,398,403],{"type":45,"tag":70,"props":350,"children":351},{},[352,354],{"type":51,"value":353},"Check if a connection string is provided in the prompt (postgresql:\u002F\u002F...).\n",{"type":45,"tag":90,"props":355,"children":356},{},[357],{"type":45,"tag":70,"props":358,"children":359},{},[360,362,368],{"type":51,"value":361},"If provided, use ",{"type":45,"tag":126,"props":363,"children":365},{"className":364},[],[366],{"type":51,"value":367},"cockroach sql --url \"\u003Cprovided-url>\" -e \"SQL\"",{"type":51,"value":369}," to run queries. Do not use psql.",{"type":45,"tag":70,"props":371,"children":372},{},[373,375,381,383],{"type":51,"value":374},"Else check the COCKROACH_URL environment variable (",{"type":45,"tag":126,"props":376,"children":378},{"className":377},[],[379],{"type":51,"value":380},"echo $COCKROACH_URL",{"type":51,"value":382},").\n",{"type":45,"tag":90,"props":384,"children":385},{},[386],{"type":45,"tag":70,"props":387,"children":388},{},[389,391,397],{"type":51,"value":390},"If set, use ",{"type":45,"tag":126,"props":392,"children":394},{"className":393},[],[395],{"type":51,"value":396},"cockroach sql --url $COCKROACH_URL -e \"SQL\"",{"type":51,"value":369},{"type":45,"tag":70,"props":399,"children":400},{},[401],{"type":51,"value":402},"Else check for cockroach-cloud MCP server availability.",{"type":45,"tag":70,"props":404,"children":405},{},[406],{"type":51,"value":407},"If none of these are available or it is unclear which cluster to use, ask the user before running anything.",{"type":45,"tag":70,"props":409,"children":410},{},[411],{"type":51,"value":412},"Focus exclusively on CockroachDB",{"type":45,"tag":70,"props":414,"children":415},{},[416],{"type":51,"value":417},"Emphasize \"natural language to CockroachDB SQL\" not \"database conversion\"",{"type":45,"tag":70,"props":419,"children":420},{},[421],{"type":51,"value":422},"Present CockroachDB-specific syntax even when a rule derives from PostgreSQL compatibility.",{"type":45,"tag":322,"props":424,"children":426},{"id":425},"output-format",[427],{"type":51,"value":428},"Output Format",{"type":45,"tag":90,"props":430,"children":431},{},[432,437,442,447,452],{"type":45,"tag":70,"props":433,"children":434},{},[435],{"type":51,"value":436},"Show generated SQL with explanatory comments",{"type":45,"tag":70,"props":438,"children":439},{},[440],{"type":51,"value":441},"List CockroachDB-specific features used",{"type":45,"tag":70,"props":443,"children":444},{},[445],{"type":51,"value":446},"Include performance considerations",{"type":45,"tag":70,"props":448,"children":449},{},[450],{"type":51,"value":451},"When optimizing, at each step 1- Explain the step's purpose. 2- Execute the step and report the outcome. 3- Summarize all findings and actions taken.",{"type":45,"tag":70,"props":453,"children":454},{},[455],{"type":51,"value":456},"Provide references used including the rules",{"type":45,"tag":46,"props":458,"children":460},{"id":459},"examples",[461],{"type":51,"value":462},"Examples",{"type":45,"tag":322,"props":464,"children":466},{"id":465},"schema-design-uuid-primary-key-avoid-hotspots",[467],{"type":51,"value":468},"Schema Design — UUID Primary Key (Avoid Hotspots)",{"type":45,"tag":470,"props":471,"children":475},"pre",{"className":472,"code":473,"language":21,"meta":474,"style":474},"language-sql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","CREATE TABLE orders (\n  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n  customer_id UUID NOT NULL,\n  status STRING NOT NULL DEFAULT 'pending',\n  total DECIMAL(10,2) NOT NULL,\n  created_at TIMESTAMPTZ NOT NULL DEFAULT now(),\n  INDEX idx_orders_customer (customer_id),\n  INDEX idx_orders_status_created (status, created_at DESC)\n);\n","",[476],{"type":45,"tag":126,"props":477,"children":478},{"__ignoreMap":474},[479,490,498,506,515,524,533,542,551],{"type":45,"tag":480,"props":481,"children":484},"span",{"class":482,"line":483},"line",1,[485],{"type":45,"tag":480,"props":486,"children":487},{},[488],{"type":51,"value":489},"CREATE TABLE orders (\n",{"type":45,"tag":480,"props":491,"children":492},{"class":482,"line":26},[493],{"type":45,"tag":480,"props":494,"children":495},{},[496],{"type":51,"value":497},"  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),\n",{"type":45,"tag":480,"props":499,"children":500},{"class":482,"line":22},[501],{"type":45,"tag":480,"props":502,"children":503},{},[504],{"type":51,"value":505},"  customer_id UUID NOT NULL,\n",{"type":45,"tag":480,"props":507,"children":509},{"class":482,"line":508},4,[510],{"type":45,"tag":480,"props":511,"children":512},{},[513],{"type":51,"value":514},"  status STRING NOT NULL DEFAULT 'pending',\n",{"type":45,"tag":480,"props":516,"children":518},{"class":482,"line":517},5,[519],{"type":45,"tag":480,"props":520,"children":521},{},[522],{"type":51,"value":523},"  total DECIMAL(10,2) NOT NULL,\n",{"type":45,"tag":480,"props":525,"children":527},{"class":482,"line":526},6,[528],{"type":45,"tag":480,"props":529,"children":530},{},[531],{"type":51,"value":532},"  created_at TIMESTAMPTZ NOT NULL DEFAULT now(),\n",{"type":45,"tag":480,"props":534,"children":536},{"class":482,"line":535},7,[537],{"type":45,"tag":480,"props":538,"children":539},{},[540],{"type":51,"value":541},"  INDEX idx_orders_customer (customer_id),\n",{"type":45,"tag":480,"props":543,"children":545},{"class":482,"line":544},8,[546],{"type":45,"tag":480,"props":547,"children":548},{},[549],{"type":51,"value":550},"  INDEX idx_orders_status_created (status, created_at DESC)\n",{"type":45,"tag":480,"props":552,"children":554},{"class":482,"line":553},9,[555],{"type":45,"tag":480,"props":556,"children":557},{},[558],{"type":51,"value":559},");\n",{"type":45,"tag":322,"props":561,"children":563},{"id":562},"batch-upsert-with-unnest",[564],{"type":51,"value":565},"Batch Upsert with UNNEST",{"type":45,"tag":470,"props":567,"children":569},{"className":472,"code":568,"language":21,"meta":474,"style":474},"UPSERT INTO inventory (sku, warehouse, quantity, updated_at)\nSELECT * FROM UNNEST(\n  ARRAY['SKU-001', 'SKU-002', 'SKU-003']::STRING[],\n  ARRAY['us-east', 'us-east', 'us-west']::STRING[],\n  ARRAY[100, 250, 75]::INT[],\n  ARRAY[now(), now(), now()]::TIMESTAMPTZ[]\n);\n",[570],{"type":45,"tag":126,"props":571,"children":572},{"__ignoreMap":474},[573,581,589,597,605,613,621],{"type":45,"tag":480,"props":574,"children":575},{"class":482,"line":483},[576],{"type":45,"tag":480,"props":577,"children":578},{},[579],{"type":51,"value":580},"UPSERT INTO inventory (sku, warehouse, quantity, updated_at)\n",{"type":45,"tag":480,"props":582,"children":583},{"class":482,"line":26},[584],{"type":45,"tag":480,"props":585,"children":586},{},[587],{"type":51,"value":588},"SELECT * FROM UNNEST(\n",{"type":45,"tag":480,"props":590,"children":591},{"class":482,"line":22},[592],{"type":45,"tag":480,"props":593,"children":594},{},[595],{"type":51,"value":596},"  ARRAY['SKU-001', 'SKU-002', 'SKU-003']::STRING[],\n",{"type":45,"tag":480,"props":598,"children":599},{"class":482,"line":508},[600],{"type":45,"tag":480,"props":601,"children":602},{},[603],{"type":51,"value":604},"  ARRAY['us-east', 'us-east', 'us-west']::STRING[],\n",{"type":45,"tag":480,"props":606,"children":607},{"class":482,"line":517},[608],{"type":45,"tag":480,"props":609,"children":610},{},[611],{"type":51,"value":612},"  ARRAY[100, 250, 75]::INT[],\n",{"type":45,"tag":480,"props":614,"children":615},{"class":482,"line":526},[616],{"type":45,"tag":480,"props":617,"children":618},{},[619],{"type":51,"value":620},"  ARRAY[now(), now(), now()]::TIMESTAMPTZ[]\n",{"type":45,"tag":480,"props":622,"children":623},{"class":482,"line":535},[624],{"type":45,"tag":480,"props":625,"children":626},{},[627],{"type":51,"value":559},{"type":45,"tag":322,"props":629,"children":631},{"id":630},"keyset-pagination-avoid-offset",[632],{"type":51,"value":633},"Keyset Pagination (Avoid OFFSET)",{"type":45,"tag":54,"props":635,"children":636},{},[637,639,645],{"type":51,"value":638},"Use the previous page's last ",{"type":45,"tag":126,"props":640,"children":642},{"className":641},[],[643],{"type":51,"value":644},"(created_at, id)",{"type":51,"value":646}," as the cursor. In application code these are bound parameters; the literals here are placeholders.",{"type":45,"tag":470,"props":648,"children":650},{"className":472,"code":649,"language":21,"meta":474,"style":474},"SELECT id, customer_id, created_at\nFROM orders\nWHERE (created_at, id) > ('2025-01-01'::TIMESTAMPTZ, '00000000-0000-0000-0000-000000000000'::UUID)\nORDER BY created_at, id\nLIMIT 50;\n",[651],{"type":45,"tag":126,"props":652,"children":653},{"__ignoreMap":474},[654,662,670,678,686],{"type":45,"tag":480,"props":655,"children":656},{"class":482,"line":483},[657],{"type":45,"tag":480,"props":658,"children":659},{},[660],{"type":51,"value":661},"SELECT id, customer_id, created_at\n",{"type":45,"tag":480,"props":663,"children":664},{"class":482,"line":26},[665],{"type":45,"tag":480,"props":666,"children":667},{},[668],{"type":51,"value":669},"FROM orders\n",{"type":45,"tag":480,"props":671,"children":672},{"class":482,"line":22},[673],{"type":45,"tag":480,"props":674,"children":675},{},[676],{"type":51,"value":677},"WHERE (created_at, id) > ('2025-01-01'::TIMESTAMPTZ, '00000000-0000-0000-0000-000000000000'::UUID)\n",{"type":45,"tag":480,"props":679,"children":680},{"class":482,"line":508},[681],{"type":45,"tag":480,"props":682,"children":683},{},[684],{"type":51,"value":685},"ORDER BY created_at, id\n",{"type":45,"tag":480,"props":687,"children":688},{"class":482,"line":517},[689],{"type":45,"tag":480,"props":690,"children":691},{},[692],{"type":51,"value":693},"LIMIT 50;\n",{"type":45,"tag":46,"props":695,"children":697},{"id":696},"supporting-documentation",[698],{"type":51,"value":699},"Supporting Documentation",{"type":45,"tag":90,"props":701,"children":702},{},[703,713],{"type":45,"tag":70,"props":704,"children":705},{},[706,711],{"type":45,"tag":126,"props":707,"children":709},{"className":708},[],[710],{"type":51,"value":199},{"type":51,"value":712}," - CockroachDB SQL rules",{"type":45,"tag":70,"props":714,"children":715},{},[716,722],{"type":45,"tag":126,"props":717,"children":719},{"className":718},[],[720],{"type":51,"value":721},"references\u002FEXAMPLES.md",{"type":51,"value":723}," - SQL examples and patterns",{"type":45,"tag":725,"props":726,"children":727},"style",{},[728],{"type":51,"value":729},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":731,"total":891},[732,751,767,782,793,803,816,826,839,854,865,878],{"slug":733,"name":733,"fn":734,"description":735,"org":736,"tags":737,"stars":748,"repoUrl":749,"updatedAt":750},"collecting-cockroachdb-operator-escalation-packet","collect CockroachDB operator escalation packets","Collects a complete CockroachDB Operator escalation packet for TSC\u002FTSE or operator-team handoff, including Helm state, Kubernetes resources, logs, operation-specific evidence, pprof goroutine dumps, metrics, and a customer action timeline. Use when general diagnosis cannot resolve an operator-managed CockroachDB Helm issue or before restarting a stuck operator.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[738,739,742,745],{"name":17,"slug":18,"type":15},{"name":740,"slug":741,"type":15},"Incident Response","incident-response",{"name":743,"slug":744,"type":15},"Kubernetes","kubernetes",{"name":746,"slug":747,"type":15},"Monitoring","monitoring",105,"https:\u002F\u002Fgithub.com\u002Fcockroachdb\u002Fhelm-charts","2026-07-12T07:57:25.288146",{"slug":752,"name":752,"fn":753,"description":754,"org":755,"tags":756,"stars":748,"repoUrl":749,"updatedAt":766},"configuring-cockroachdb-helm-tls","configure TLS for CockroachDB Helm charts","Selects and validates TLS settings for CockroachDB Helm chart deployments, including self-signer, cert-manager, and external certificate modes. Use when a customer needs secure CockroachDB Helm values, certificate secret mapping, cert-manager integration, or TLS install troubleshooting before deploying the chart.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[757,760,763],{"name":758,"slug":759,"type":15},"Deployment","deployment",{"name":761,"slug":762,"type":15},"Encryption","encryption",{"name":764,"slug":765,"type":15},"Security","security","2026-07-12T07:56:37.675396",{"slug":768,"name":768,"fn":769,"description":770,"org":771,"tags":772,"stars":748,"repoUrl":749,"updatedAt":781},"debugging-cockroachdb-operator-migrations","debug CockroachDB Operator migration scenarios","Debugs CockroachDB Operator migration scenarios, including Helm StatefulSet to v1beta1 CrdbNode migration and public operator v1alpha1 to v1beta1 migration. Use when migration labels, migration phases, source StatefulSet ownership, converted CRDs, PVC ownership, or post-migration reconciliation are unclear or stuck.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[773,774,777,778],{"name":17,"slug":18,"type":15},{"name":775,"slug":776,"type":15},"Debugging","debugging",{"name":743,"slug":744,"type":15},{"name":779,"slug":780,"type":15},"Migration","migration","2026-07-12T07:56:48.360871",{"slug":783,"name":783,"fn":784,"description":785,"org":786,"tags":787,"stars":748,"repoUrl":749,"updatedAt":792},"diagnosing-cockroachdb-helm-deployments","diagnose CockroachDB Helm chart deployments","Diagnoses failed or unhealthy CockroachDB Helm chart deployments by checking Helm release state, operator health, CrdbCluster and CrdbNode status, pod readiness, RBAC, webhooks, TLS, upgrades, scaling, PVCs, DNS, and multi-region assumptions. Use when Helm install or upgrade fails, pods are not Ready, or the operator is not reconciling.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[788,789,790,791],{"name":17,"slug":18,"type":15},{"name":775,"slug":776,"type":15},{"name":758,"slug":759,"type":15},{"name":743,"slug":744,"type":15},"2026-07-12T07:57:24.018818",{"slug":794,"name":794,"fn":795,"description":796,"org":797,"tags":798,"stars":748,"repoUrl":749,"updatedAt":802},"installing-cockroachdb-with-helm","install CockroachDB using Helm","Guides customer-facing installation of CockroachDB on Kubernetes using the CockroachDB split Helm charts and operator-managed v1beta1 resources. Use when installing CockroachDB with Helm, choosing between published and local split charts, verifying a new install, or helping an agent complete first-time Kubernetes onboarding.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[799,800,801],{"name":17,"slug":18,"type":15},{"name":758,"slug":759,"type":15},{"name":743,"slug":744,"type":15},"2026-07-12T07:56:45.777567",{"slug":804,"name":804,"fn":805,"description":806,"org":807,"tags":808,"stars":748,"repoUrl":749,"updatedAt":815},"validating-cockroachdb-helm-multiregion","validate CockroachDB multi-region Helm deployments","Validates CockroachDB Helm chart values and Kubernetes prerequisites for operator-managed multi-region deployments. Use before adding a region, deploying CockroachDB across multiple Kubernetes clusters, checking region DNS domains, or confirming that all regions share certificate and networking assumptions.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[809,810,811,812],{"name":17,"slug":18,"type":15},{"name":758,"slug":759,"type":15},{"name":743,"slug":744,"type":15},{"name":813,"slug":814,"type":15},"Operations","operations","2026-07-12T07:56:47.082609",{"slug":817,"name":817,"fn":818,"description":819,"org":820,"tags":821,"stars":22,"repoUrl":23,"updatedAt":825},"analyzing-range-distribution","analyze CockroachDB range distribution and health","Analyzes CockroachDB range distribution across tables and indexes using SHOW RANGES to identify range count, size patterns, leaseholder placement, and replication health. Use when investigating hotspots, uneven data distribution, range fragmentation, or validating zone configuration effects without DB Console access.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[822,823,824],{"name":17,"slug":18,"type":15},{"name":746,"slug":747,"type":15},{"name":13,"slug":14,"type":15},"2026-07-12T07:57:18.753533",{"slug":827,"name":827,"fn":828,"description":829,"org":830,"tags":831,"stars":22,"repoUrl":23,"updatedAt":838},"analyzing-schema-change-storage-risk","analyze schema change storage requirements","Estimates storage requirements for CockroachDB online schema change backfills using SHOW RANGES WITH DETAILS, KEYS, INDEXES. Use before CREATE INDEX, ADD COLUMN with INDEX\u002FUNIQUE, ALTER PRIMARY KEY, CREATE MATERIALIZED VIEW, CREATE TABLE AS, REFRESH, or SET LOCALITY on tables with large per-index footprints, to avoid mid-backfill disk exhaustion.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[832,835,836,837],{"name":833,"slug":834,"type":15},"Data Modeling","data-modeling",{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},"2026-07-12T07:57:22.763788",{"slug":840,"name":840,"fn":841,"description":842,"org":843,"tags":844,"stars":22,"repoUrl":23,"updatedAt":853},"auditing-cis-benchmark","audit CockroachDB clusters against CIS benchmarks","Audits a self-hosted CockroachDB cluster against the CIS CockroachDB Benchmark v1.0.0 Level 1 controls. Supports two audit depths — quick automated scans and full CIS audit procedures. Produces a structured PASS\u002FFAIL\u002FMANUAL report covering installation, system hardening, logging, user access, data protection, and CockroachDB settings. Use when preparing for CIS compliance assessments, hardening self-hosted deployments, or validating security posture against industry benchmarks.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[845,848,851,852],{"name":846,"slug":847,"type":15},"Audit","audit",{"name":849,"slug":850,"type":15},"Compliance","compliance",{"name":17,"slug":18,"type":15},{"name":764,"slug":765,"type":15},"2026-07-18T05:48:00.862384",{"slug":855,"name":855,"fn":856,"description":857,"org":858,"tags":859,"stars":22,"repoUrl":23,"updatedAt":864},"auditing-cloud-cluster-security","audit CockroachDB cluster security posture","Audits the security posture of a CockroachDB cluster (Cloud or self-hosted) across network, authentication, authorization, encryption, audit logging, and backup dimensions. Use when assessing cluster security readiness, preparing for compliance reviews, or investigating security configuration gaps.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[860,861,862,863],{"name":846,"slug":847,"type":15},{"name":17,"slug":18,"type":15},{"name":813,"slug":814,"type":15},{"name":764,"slug":765,"type":15},"2026-07-12T07:57:01.506735",{"slug":866,"name":866,"fn":867,"description":868,"org":869,"tags":870,"stars":22,"repoUrl":23,"updatedAt":877},"auditing-table-statistics","audit optimizer table statistics","Audits optimizer table statistics for staleness, missing coverage, and data quality issues using SHOW STATISTICS. Use when diagnosing poor query performance, unexpected plan changes, or after bulk data changes to identify stale statistics requiring refresh via CREATE STATISTICS.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[871,872,875,876],{"name":846,"slug":847,"type":15},{"name":873,"slug":874,"type":15},"Data Analysis","data-analysis",{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},"2026-07-12T07:57:16.190081",{"slug":879,"name":879,"fn":880,"description":881,"org":882,"tags":883,"stars":22,"repoUrl":23,"updatedAt":890},"benchmarking-transaction-patterns","benchmark CockroachDB transaction patterns","Guides benchmarking and comparing explicit multi-statement transactions versus single-statement CTE transactions in CockroachDB, with fair test methodology, contention analysis, and performance interpretation. Use when comparing transaction formulations, benchmarking CockroachDB workloads under contention, investigating retry pressure, or deciding whether to rewrite multi-step application flows into single SQL statements.",{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[884,885,888,889],{"name":17,"slug":18,"type":15},{"name":886,"slug":887,"type":15},"Engineering","engineering",{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},"2026-07-12T07:57:26.543278",40,{"items":893,"total":941},[894,900,907,914,921,928,935],{"slug":817,"name":817,"fn":818,"description":819,"org":895,"tags":896,"stars":22,"repoUrl":23,"updatedAt":825},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[897,898,899],{"name":17,"slug":18,"type":15},{"name":746,"slug":747,"type":15},{"name":13,"slug":14,"type":15},{"slug":827,"name":827,"fn":828,"description":829,"org":901,"tags":902,"stars":22,"repoUrl":23,"updatedAt":838},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[903,904,905,906],{"name":833,"slug":834,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},{"slug":840,"name":840,"fn":841,"description":842,"org":908,"tags":909,"stars":22,"repoUrl":23,"updatedAt":853},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[910,911,912,913],{"name":846,"slug":847,"type":15},{"name":849,"slug":850,"type":15},{"name":17,"slug":18,"type":15},{"name":764,"slug":765,"type":15},{"slug":855,"name":855,"fn":856,"description":857,"org":915,"tags":916,"stars":22,"repoUrl":23,"updatedAt":864},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[917,918,919,920],{"name":846,"slug":847,"type":15},{"name":17,"slug":18,"type":15},{"name":813,"slug":814,"type":15},{"name":764,"slug":765,"type":15},{"slug":866,"name":866,"fn":867,"description":868,"org":922,"tags":923,"stars":22,"repoUrl":23,"updatedAt":877},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[924,925,926,927],{"name":846,"slug":847,"type":15},{"name":873,"slug":874,"type":15},{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"slug":879,"name":879,"fn":880,"description":881,"org":929,"tags":930,"stars":22,"repoUrl":23,"updatedAt":890},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[931,932,933,934],{"name":17,"slug":18,"type":15},{"name":886,"slug":887,"type":15},{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},{"slug":4,"name":4,"fn":5,"description":6,"org":936,"tags":937,"stars":22,"repoUrl":23,"updatedAt":24},{"slug":8,"name":9,"logoUrl":10,"githubOrg":8},[938,939,940],{"name":17,"slug":18,"type":15},{"name":13,"slug":14,"type":15},{"name":20,"slug":21,"type":15},34]