This is a production-focused reference for MySQL and MariaDB work that covers schema design, indexing strategy, transaction patterns, and connection pooling. It starts with version checks because the two databases have diverged on syntax like upsert row aliases, then walks through composite index ordering, keyset pagination instead of deep offsets, queue patterns with SKIP LOCKED, and deadlock prevention through deterministic lock ordering. The examples are concrete, from DECIMAL for money to pool_recycle settings aligned with server wait_timeout. Useful when you're reviewing migrations on large tables, debugging lock waits, or setting up connection pools that won't leak or timeout under load.

skills.sh installs
1.8K
GitHub stars
229.1K
last updated
Jul 14, 2026

Install

$ npx -y skills add affaan-m/everything-claude-code --skill mysql-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

MySQL Patterns

Use this skill when working on MySQL or MariaDB schema design, migrations, slow-query investigation, queue-style transactions, connection pools, or production database configuration. Prefer exact version checks before applying a feature-specific pattern because MySQL and MariaDB have diverged in several SQL details.

Activation

  • Designing MySQL or MariaDB tables, indexes, and constraints
  • Reviewing migrations before they run on large production tables
  • Debugging slow queries, lock waits, deadlocks, or connection exhaustion
  • Adding keyset pagination, upserts, full-text search, JSON columns, or queues
  • Configuring application connection pools, read replicas, TLS, or slow logs

Version Check

Start by identifying the engine and version:

SELECT VERSION();
SHOW VARIABLES LIKE 'version_comment';

Keep MySQL and MariaDB guidance separate when syntax differs:

Sponsors

Details

Repository
github.com/affaan-m/everything-claude-code
Categories
Backend & APIs, Databases
First seen
Jun 3, 2026

More from affaan-m/everything-claude-code

All 256
1sickn33 avatardatabase-designsickn33/antigravity-awesome-skillsdatabase design1.7Kskills.sh installs
2affaan-m avatarprisma-patternsaffaan-m/everything-claude-codeprisma patterns1.4Kskills.sh installs
3lobehub avatardrizzlelobehub/lobe-chatdrizzle1.4Kskills.sh installs
4mindrally avatarnextjs-typescript-tailwindcss-supabasemindrally/skillsFull-stack Next.js 14 development with TypeScript, TailwindCSS, and Supabase for building production-ready web applications.1.4Kskills.sh installs
5aradotso avatartavily-key-generator-proxyaradotso/trending-skillstavily key generator proxy1.3Kskills.sh installs
6sickn33 avatarbackend-architectsickn33/antigravity-awesome-skillsbackend architect1.3Kskills.sh installs