affaan-m avatar

Mysql Patterns

This is your reference when you're past the MySQL tutorial stage and need production-ready patterns for schema design, indexing, transactions, and connection pools. It covers the version divergence between MySQL and MariaDB (like the VALUES() deprecation in upserts), shows you how to build composite indexes that actually get used, and walks through keyset pagination, queue-style job claiming with SKIP LOCKED, and deadlock prevention. The schema defaults table alone will save you from common mistakes like using FLOAT for money or utf8 instead of utf8mb4. If you're debugging slow queries, tuning connection pools, or reviewing a migration before it locks a production table for twenty minutes, this gives you the patterns and EXPLAIN checklist you need.

skills.sh installs
5.7K
GitHub stars
300.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add affaan-m/ecc --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/ecc
Categories
Backend & APIs, Databases
First seen
Jul 14, 2026

More from affaan-m/ecc

All 263
1affaan-m avatarapi-connector-builderaffaan-m/eccBuild a new API connector or provider by matching the target repo's existing integration pattern exactly. Use when adding one more integration without inventing5.5Kskills.sh installs
2affaan-m avatarmcp-server-patternsaffaan-m/everything-claude-codemcp server patterns4.6Kskills.sh installs
3wordpress avatarwp-interactivity-apiwordpress/agent-skillsUse when building or debugging WordPress Interactivity API features (data-wp-* directives, @wordpress/interactivity store/state/actions, block viewScriptModule 4.5Kskills.sh installs
4ghostsecurity avatarghost-proxyghostsecurity/skillsStarts and controls the reaper MITM proxy to capture, inspect, search, and replay HTTP/HTTPS traffic between clients and servers. Capabilities include starting/4.2Kskills.sh installs
5yaklang avatarapi-secyaklang/hack-skillsEntry P1 category router for API security. Use when choosing between API recon, authorization, token abuse, and hidden-parameter workflows before any deeper API4.1Kskills.sh installs
6yaklang avatarauthbypass-authentication-flawsyaklang/hack-skillsAuthentication bypass testing playbook. Use when assessing login flows, password reset logic, account recovery, MFA bypass, token predictability, brute-force re4Kskills.sh installs