database

Design relational database schemas and optimize queries across PostgreSQL, Prisma, SQLAlchemy, GORM, and Drizzle.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/dotBeeps/hoard --skill database-dotbeeps
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database
Source: https://github.com/dotBeeps/hoard/tree/main/morsels/skills/database
Command: npx skills add https://github.com/dotBeeps/hoard --skill database-dotbeeps

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides practical patterns and guardrails for designing relational schemas, writing safe migrations, optimizing queries, and using ORMs to avoid common runtime and performance issues.

Core Features & Use Cases

  • Schema and naming conventions: guidance on table/column naming, primary key strategies, audit columns, and when to denormalize.
  • Safe migrations: forward-only migration patterns, multi-step deployment strategies, and tools for Prisma, Alembic, Knex, Goose, and Drizzle.
  • Indexing and query tuning: index types, composite and partial indexes, covering indexes, EXPLAIN analysis, and pagination strategies.
  • ORM best practices: ORM-specific patterns for Prisma, Drizzle, SQLAlchemy, and GORM to avoid N+1, manage transactions, and use raw SQL when necessary.
  • Use Case: review a production schema to add a new non-null column with zero-downtime backfill and appropriate indexing to support a new query pattern.

Quick Start

Ask the database skill to review a schema and recommend safe, stepwise migrations and indexing changes to add a non-null field without downtime.

Frequently Asked Questions about database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a non-null column to a PostgreSQL database without downtime?

To add a non-null column without downtime, use multi-step forward-only migrations to deploy schema changes incrementally, backfill rows, and create indexes concurrently before enforcing constraints.

What's the best way to avoid N+1 query problems in ORMs like Prisma and SQLAlchemy?

Avoiding N+1 queries in ORMs like Prisma and SQLAlchemy requires applying ORM-specific patterns such as eager loading relations, managing transactions effectively, and utilizing raw SQL when necessary to optimize complex data fetching.

When do I need composite or partial indexes for query optimization?

You need composite or partial indexes for query optimization when filtering on multiple columns or specific subsets of data. Analyzing EXPLAIN plans helps identify slow queries, guiding the creation of covering indexes and efficient pagination strategies.

Does this database skill provide migration guidance for Drizzle and GORM?

Yes, this database skill provides migration guidance for Drizzle, GORM, Prisma, Alembic, Knex, and Goose. It offers forward-only migration workflows, safe schema change patterns, and ORM-specific practices to avoid common runtime and performance pitfalls.

What are the recommended naming conventions and primary key strategies for schema design?

Recommended schema design conventions include standardized table and column naming, appropriate primary key strategies, and adding audit columns. It also provides guidance on determining when to denormalize for performance or resilience.

Why should I use forward-only migrations instead of reversible database workflows?

Forward-only migrations ensure auditability and safer production deployments by preventing data loss from destructive rollback scripts. This approach enforces multi-step deployment strategies and concurrent index creation to maintain high availability during schema evolution.