mysqlWrite correct MySQL queries avoiding common pitfalls with character sets, indexes, and locking.
Install via ClawdBot CLI:
clawdbot install ivangdavila/mysqlRequires:
| Topic | File |
|-------|------|
| Index design deep dive | indexes.md |
| Transactions and locking | transactions.md |
| Query optimization | queries.md |
| Production config | production.md |
utf8 is brokenâonly 3 bytes, can't store emoji; always use utf8mb4utf8mb4_unicode_ci for case-insensitive sorting; utf8mb4_bin for exact byte comparisonSET NAMES utf8mb4 or connection string parameterWHERE active = true in index definitionINDEX (description(100))âwithout length, errorINDEX (a, b, c) to cover cINSERT ... ON DUPLICATE KEY UPDATEânot standard SQL; needs unique key conflictLAST_INSERT_ID() for auto-incrementâno RETURNING clause like PostgreSQLREPLACE INTO deletes then insertsâchanges auto-increment ID, triggers DELETE cascadeSELECT ... FOR UPDATE locks rowsâbut gap locks may lock more than expectedinnodb_lock_wait_timeout for adjustmentFOR UPDATE SKIP LOCKED exists in MySQL 8+âqueue patternsql_mode includes ONLY_FULL_GROUP_BY by default in MySQL 5.7+ANY_VALUE(column) to silence error when you know values are sameSHOW TABLE STATUSâconvert with ALTER TABLE ... ENGINE=InnoDBLIMIT offset, count different order than PostgreSQL's LIMIT count OFFSET offset!= and <> both work; prefer <> for SQL standardALTER TABLE commits immediately, can't rollbackTINYINT(1)âTRUE/FALSE are just 1/0IFNULL(a, b) instead of COALESCE for two argsâthough COALESCE workswait_timeout kills idle connectionsâdefault 8 hours; pooler may not noticemax_connections default 151âoften too low; each uses memorySHOW PROCESSLIST to see active connectionsâkill long-running with KILL Seconds_Behind_Master before relying on replica readsEXPLAIN ANALYZE only in MySQL 8.0.18+âolder versions just EXPLAIN without actual timesOPTIMIZE TABLE for fragmented tablesâlocks table; use pt-online-schema-change for big tablesinnodb_buffer_pool_sizeâset to 70-80% of RAM for dedicated DB serverAI Usage Analysis
Analysis is being generated⊠refresh in a few seconds.
Use the @steipete/oracle CLI to bundle a prompt plus the right files and get a second-model review (API or browser) for debugging, refactors, design checks, or cross-validation.
Manage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database). Use when a user asks Clawdbot to add a task to Things, list inbox/today/upcoming, search tasks, or inspect projects/areas/tags.
Local search/indexing CLI (BM25 + vectors + rerank) with MCP mode.
Use when designing database schemas, writing migrations, optimizing SQL queries, fixing N+1 problems, creating indexes, setting up PostgreSQL, configuring EF Core, implementing caching, partitioning tables, or any database performance question.
Connect to Supabase for database operations, vector search, and storage. Use for storing data, running SQL queries, similarity search with pgvector, and managing tables. Triggers on requests involving databases, vector stores, embeddings, or Supabase specifically.
Query, design, migrate, and optimize SQL databases. Use when working with SQLite, PostgreSQL, or MySQL â schema design, writing queries, creating migrations, indexing, backup/restore, and debugging slow queries. No ORMs required.