23 skills · category
Databases skills for Claude Code
Skills for schema design, query plans, indexes, zero-downtime migrations, transactions and locking, row-level security, backups that restore, and the specifics of Postgres, Prisma, Drizzle, MongoDB, Redis, SQLite, ClickHouse and DuckDB.
- 192Backup and Restore
- 193ClickHouse Analytics
- 194Connection Pooling
- 195Drizzle ORM
- 196DuckDB Analytics
- 197DynamoDB Modeling
- 198Elasticsearch Search
- 199MongoDB Modeling
- 200MySQL Tuning
- 201Neo4j Graphs
- 202Postgres Full-Text Search
- 203Postgres Indexing
- 204Postgres JSONB
- 205Postgres Schema Design
- 206Prisma ORM
- 207Redis Patterns
- 208Postgres Row-Level Security
- 209Zero-Downtime Migrations
- 210SQL Query Tuning
- 211SQLAlchemy ORM
- 212SQLite in Production
- 213TimescaleDB Time-Series
- 214Transactions and Locking
Every databases skill
Each card opens the full playbook, example prompts and install commands.
Backup and Restore
Backups count only after a timed restore
Claude starts from agreed RPO and RTO targets and picks the mechanism that meets them: logical dumps, physical backups with WAL archiving for point-in-time recovery, or managed PITR plus off-account copies. It restores to a separate instance by default, verifies restored data with queries and smoke tests, alerts on archive failures and backup age, and records each drill's real recovery time.
ClickHouse Analytics
Sorting keys that skip 99% of granules
Claude designs ClickHouse tables from the dominant queries: a sorting key that prunes granules, coarse monthly partitions, LowCardinality and codecs, and the right MergeTree variant for upserts or rollups. Ingestion is batched or uses async inserts with wait enabled, dedup queries use FINAL or argMax, and EXPLAIN indexes plus system.parts confirm granules read and part counts.
Connection Pooling
Pools sized to database cores, not request counts
Claude writes down every process that connects and sums its maximum connections against the database limit at full autoscale before touching a setting. Pools are sized from database parallelism, PgBouncer transaction mode is configured with its session-state caveats and prepared statement support, serverless platforms get a proxy, and exhaustion is diagnosed from pg_stat_activity and SHOW POOLS.
Drizzle ORM
Typed SQL, reviewed migrations, zero drift
Claude writes Drizzle schemas as the single source of truth: timezone-aware timestamps, named indexes on every foreign key, types inferred with $inferSelect instead of duplicated interfaces. It keeps push for local prototyping only, reads each generated SQL file for accidental drop-and-add renames, and picks between the core builder and relational queries based on what the result needs.
DuckDB Analytics
SQL over Parquet and CSV files, no warehouse needed
Claude queries data files directly with DuckDB instead of loading them into pandas first. It inspects schemas with DESCRIBE and SUMMARIZE, pins types that auto-detection gets wrong such as zip codes and day-first dates, writes analysis with GROUP BY ALL, QUALIFY and ASOF JOIN, sets memory limits so big jobs spill to disk, and checks row counts and totals against the source.
DynamoDB Modeling
Keys designed from queries, not from entity diagrams
Claude refuses to write a key until an access-pattern inventory with rates exists, then maps each pattern to one GetItem, Query, or transaction. It co-locates entities read together, adds sparse or multi-attribute GSIs only where the base table falls short, enforces uniqueness with guard items and condition expressions, and shards keys that would exceed per-partition throughput.
Elasticsearch Search
Explicit mappings, measured relevance, sane shards
Claude writes strict index templates instead of trusting dynamic mapping, maps each field for how it is queried, and puts every exact constraint in filter context. Mapping changes go through a versioned index, _reindex, and an atomic alias swap. Relevance changes are judged with _rank_eval, and red or yellow clusters are diagnosed with allocation explain before anyone restarts a node.
MongoDB Modeling
Model documents for reads, not for an ERD
Claude starts from a workload table, then decides per relationship whether to embed, reference, or use subset, bucket and extended-reference patterns. Arrays stay bounded, compound indexes follow Equality-Sort-Range, collections get $jsonSchema validators with Decimal128 money and real dates, and every hot query is checked with explain executionStats so documents examined stay close to documents returned.
MySQL Tuning
Fix the top digests, keep replicas caught up
Claude ranks statements by total latency from performance_schema, reads EXPLAIN ANALYZE to spot scans, filesorts and implicit conversions, and builds composite indexes in InnoDB's clustered-key reality. It sizes the buffer pool and redo log, diagnoses replica lag by cause, retires indexes via INVISIBLE first, and picks INSTANT, INPLACE or gh-ost per schema change.
Neo4j Graphs
Graph models anchored on indexes, traversals bounded
Claude first checks whether the questions are really traversals, then models nouns as labeled nodes and verbs as typed, directed relationships. Constraints come before data, loads MERGE only on constrained keys in batched transactions, and every hot Cypher query is profiled until it starts with an index seek and has no unbounded expansion, cartesian product or Eager step.
Postgres Full-Text Search
Real search in the database you already run
Claude builds a weighted, stored tsvector column with the right language configuration, indexes it with GIN, and parses user input with websearch_to_tsquery so no query can error. Ranking runs only over the matched set, snippets are generated for the final page only, pg_trgm covers names and typos, and the skill states plainly when Elasticsearch or a hosted engine is the better call.
Postgres Indexing
Every index justified by a plan, every drop by data
Claude designs the narrowest index that serves a named query: equality columns before range columns, partial predicates for queue and soft-delete tables, INCLUDE columns for index-only scans, trigram GIN for ILIKE search. Builds run CONCURRENTLY with a lock timeout and an invalid-index check, and a diagnostic SQL catalog finds unused, duplicate and FK-missing indexes before any drop.
Postgres JSONB
Flexible documents without giving up indexes
Claude decides per attribute whether it belongs in a column, a JSONB document or a child table, then validates documents with CHECK constraints at the database edge. Queries are written with GIN-compatible containment and jsonpath operators, hot keys become indexed expressions or stored generated columns, and expression statistics fix the planner's blind spot for keys inside JSON.
Postgres Schema Design
Tables where bad data simply cannot land
Claude designs tables from the queries they must serve, then picks a precise type for every column: timestamptz over timestamp, integer cents over floats, identity or UUIDv7 keys. Rules go into NOT NULL, CHECK, UNIQUE and foreign keys with an explicit ON DELETE, foreign keys get indexes, and JSONB is reserved for genuinely variable data. Reviews end with a blocking/should-fix note.
Prisma ORM
Read the SQL Prisma writes before it hits prod
Claude treats Prisma as a SQL generator it must supervise. Models get timestamptz and indexed relation fields, every generated migration.sql is read for silent drops and table rewrites, and production only ever sees migrate deploy. Queries select only needed fields with cursor pagination, transactions stay short, and the setup matches your installed Prisma major, including the Prisma 7 driver-adapter client.
Redis Patterns
Caches, limits and locks that survive a flush
Claude decides first whether Redis is a cache, a coordination layer or a primary store, and configures eviction and persistence to match. Keys get a naming scheme and TTLs, caches invalidate after commit with jitter and stampede guards, locks release only with an owner check, rate limiters run as atomic Lua, and memory problems are traced with --bigkeys and MEMORY USAGE instead of KEYS.
Postgres Row-Level Security
Tenant isolation the database enforces and tests prove
Claude sets up RLS so it cannot be bypassed by accident: a runtime role without BYPASSRLS that does not own the tables, ENABLE plus FORCE on every tenant table, and tenant context passed per transaction with set_config so poolers never leak it. It closes the side doors through views, SECURITY DEFINER functions and foreign keys, and writes SQL tests that fail when one tenant can see another.
Zero-Downtime Migrations
Change live tables without a maintenance window
Claude splits risky schema changes into expand, backfill and contract phases that each work with old and new code running side by side. Every ALTER runs with lock_timeout, constraints go in NOT VALID and get validated separately, backfills run as resumable batches outside the DDL, and drops wait for a later deploy and your sign-off. You get a phase-by-phase plan with locks and rollback per step.
SQL Query Tuning
Find the slow plan node, fix the estimate behind it
Claude stops guessing from SQL text and works from the plan. It ranks queries by total time in pg_stat_statements, captures EXPLAIN ANALYZE with real parameters, finds the node where estimates diverge, then applies the smallest fix in order: statistics, query rewrite, index, scoped config. Every change gets a before/after plan comparison with buffer counts and a short tuning note.
SQLAlchemy ORM
Typed models, owned sessions, loads you chose on purpose
Makes Claude write SQLAlchemy 2.x the way it is meant to be used: Mapped and mapped_column models with named constraints, one Session per request or task with short transactions, select() queries with deliberate selectinload or joinedload, and lazy="raise" to catch accidental lazy loads. It also reviews Alembic autogenerate output for the renames and enum changes it misses, and sets up rollback-per-test fixtures.
SQLite in Production
One file, real pragmas, no more database is locked
Claude configures SQLite like a server database: WAL mode, busy_timeout and foreign_keys on every connection, BEGIN IMMEDIATE for writes so SQLITE_BUSY becomes a short wait, STRICT tables, and user_version migrations with the official table-rebuild procedure. A bundled stdlib Python script reports integrity, FK violations, WAL growth and unindexed foreign keys, and backups use VACUUM INTO or Litestream.
TimescaleDB Time-Series
Hypertables, rollups and retention sized to your ingest
Claude sizes chunk intervals from ingest volume and memory, picks a columnstore segmentby that matches the dominant filter, and points dashboards at continuous aggregates with refresh windows that cover late data. Retention drops chunks rather than deleting rows, and when TimescaleDB is unavailable it falls back to native range partitioning with BRIN indexes.
Transactions and Locking
Name the race, pick the lock, prove it under load
Claude names the exact anomaly behind a concurrency bug, such as lost update, write skew or double insert, then applies the cheapest mechanism that prevents it: a unique index, a guarded atomic UPDATE, a version check, FOR UPDATE in key order, or Serializable with retries. Every role gets lock and idle-transaction timeouts, and the fix is proven with a real parallel test.
Choosing Databases skills
Install the skills that match requests you make every week; each costs about 100 tokens of standing context until it loads. If you are not sure where to begin, start with DynamoDB Modeling, Zero-Downtime Migrations and SQL Query Tuning. For background, read The Best Claude Code Skills in 2026, by Use Case, How to Install Claude Code Skills (5 Ways) and Personal vs Project Skills.
By technology: PostgreSQL skillsSQL skillsMySQL skillsPython skillsAWS skills
Install several
Install several at once
The installer accepts any number of skill names. Add --project to install into the current repository.
curl -fsSL https://claudeskills.page/install.sh | sh -s -- backup-restore clickhouse-analytics connection-pooling drizzle-orm duckdb-analytics dynamodb-modeling elasticsearch-search mongodb-modeling mysql-tuning neo4j-graphs postgres-full-text-search postgres-indexing postgres-jsonb postgres-schema-design prisma-orm redis-patterns row-level-security schema-migrations sql-query-tuning sqlalchemy-orm sqlite-local-first timescale-timeseries transactions-locking Databases skills FAQ
How do I install every Databases skill at once?
Download the bundle at https://claudeskills.page/downloads/category/databases.zip and unzip it into ~/.claude/skills/ (or .claude/skills/ inside a repository). To pick a few, pass several names to the installer: curl -fsSL https://claudeskills.page/install.sh | sh -s -- backup-restore clickhouse-analytics connection-pooling.
Will installing 23 skills slow Claude Code down?
No. Claude Code keeps only each skill's short description in context — roughly 100 tokens per skill — and loads the full instructions only when a request matches. Install the whole category if it fits your work; unused skills cost almost nothing.
Which Databases skill should I start with?
Start with DynamoDB Modeling, Zero-Downtime Migrations, SQL Query Tuning. They cover the most common requests in this category; add the rest as your work calls for them.
Featured in Production Backend, Data Engineering Stack.
Explore other categories
- Claude Code Mastery
- Engineering Workflow
- Frontend
- Backend & APIs
- Languages
- Testing
- DevOps & SRE
- Cloud Platforms
- Data Engineering
- AI Engineering
- Security
- Performance
- Architecture
- Mobile
- Design & UX
- Documents & Files
- Technical Writing
- Integrations
- SEO & Growth
- Game Development
- Embedded & IoT
- Product Management
- Research & Analysis
- Automation & Tooling