
planetscale/database-skills
4 skills11.2k installs1.9k starsGitHub
Install
npx skills add https://github.com/planetscale/database-skillsSkills in this repo
1MysqlThis PlanetScale-originated MySQL skill is a focused reference for solo builders and small teams who ship Laravel, Node, or generic SaaS backends on MySQL-compatible engines. It explains why utf8 in MySQL is not full Unicode, why utf8mb4 should be the default for new databases, and how to pick among utf8mb4_0900_ai_ci, accent- and case-sensitive variants, and binary collations for tokens and hashes. You get copy-paste DDL for database defaults, a behavior matrix for comparisons and sorting, and migration guidance to audit utf8mb3 columns via information_schema. Use it during schema design, before launch when international users or emoji appear in data, and when debugging mysterious sort or duplicate-key issues tied to collation. It does not replace a full DBA runbook but prevents the most common charset footguns that break production data silently.4.8kinstalls2PostgresThis PlanetScale database-skills package covers PostgreSQL backup and recovery for solo builders and small teams running their own Postgres. It walks through logical exports with pg_dump (plain SQL, custom, directory, and tar formats), physical cloning with pg_basebackup, and point-in-time recovery that depends on WAL archiving and a correct archive_command. The skill stresses operational fundamentals: know your recovery point objective, prefer parallel directory dumps for large databases, and never treat backups as complete until you have rehearsed a restore. It is aimed at indie SaaS and API operators who need portable disaster recovery without guessing flags or mixing incompatible PG versions during physical restore.4.7kinstalls3VitessVitess is a horizontal scaling layer for MySQL: apps speak MySQL to VTGate, which routes to VTTablet sidecars on each mysqld using topology metadata. This skill is a condensed architecture guide for solo and indie builders who use PlanetScale or self-hosted Vitess and need a mental model before changing keyspaces, shards, or failover behavior. It walks through query routing and VSchema, cross-shard execution, single- versus multi-shard transactions (including 2PC in newer releases), query buffering during failovers and cutovers, and practical shard targeting with USE directives. VTTablet responsibilities—pooling, health, throttling on replication lag, backup/restore—are framed so you can reason about operational tradeoffs while still in the design phase. Use it when you are planning multi-tenant SaaS data isolation, evaluating read replicas versus shards, or debugging why queries hit the wrong tablet type.869installs4NekiPre-sharding PostgreSQL is an agent skill that walks solo builders through shard-key selection, primary-key layout, and query patterns while the database is still a single Postgres instance. It targets founders and small teams on SaaS or API products who expect multi-tenant growth but are not ready to operate shards yet. The skill stresses choosing a high-cardinality, evenly distributed key present on scoped tables, leading composite keys on dependents, and shaping WHERE clauses so frequent reads stay shard-local. It contrasts single-column PKs when the PK is the natural shard key with leading composite keys elsewhere, and recommends UUIDs where global uniqueness avoids coordination pain. Use it during initial schema design, before adding tables that lack tenant scope, or when reviewing queries that could force cross-shard joins later. The outcome is a Postgres model that can split with minimal migration drama rather than a last-minute redesign under load.841installs