postgresql

Design PostgreSQL schemas, SQLAlchemy models, and Alembic migrations for FastAPI projects.

Updated Oct 28, 2025
One-click install
npx skills add https://github.com/kilburn/AIseminar --skill postgresql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/kilburn/AIseminar/tree/main/task-scheduler-in-vue-tailwind-and-fastapi/.claude/skills/postgresql
Command: npx skills add https://github.com/kilburn/AIseminar --skill postgresql

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developing with PostgreSQL, SQLAlchemy, and Alembic involves complex schema design, migrations, and performance tuning. This Skill provides expert guidance and guardrails to prevent common pitfalls and ensure robust, efficient database operations, allowing you to focus on building features.

Core Features & Use Cases

  • Schema Design & Modeling: Get best practices for tables, constraints, indexes, and SQLAlchemy ORM models, ensuring data integrity and optimal structure.
  • Alembic Migrations: Safely create and manage database schema changes, including concurrent index creation, minimizing downtime and risk.
  • Performance & Ops: Optimize queries, diagnose locks, and follow safety guardrails for critical operations, keeping your application fast and reliable.
  • Use Case: When designing a new feature requiring database changes, use this Skill to ensure your schema is robust, migrations are safe, and queries are performant from the start, avoiding costly refactors later.

Quick Start

Using the postgresql skill, provide an example SQLAlchemy model for a 'Product' table with fields for name, price, and a foreign key to a 'Category' table.

Frequently Asked Questions about postgresql

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

FAQPage Schema
How do I design a PostgreSQL schema with SQLAlchemy models for a FastAPI application?

Design PostgreSQL schemas by defining SQLAlchemy ORM models with explicit constraints, surrogate primary keys, and foreign key relationships. This Skill provides best practices for table structure, indexes, and data integrity to ensure robust, optimal database design before implementation.

What's the best way to manage database migrations safely with Alembic in PostgreSQL?

Create and manage PostgreSQL schema changes using Alembic migrations with concurrent index creation and transaction safety. This approach minimizes downtime and risk by enforcing READ COMMITTED isolation and safe-ops guardrails during deployment.

How do I diagnose and fix slow queries or locking issues in PostgreSQL?

Diagnose slow queries and locking problems by analyzing query performance and transaction conflicts. This Skill provides performance-oriented checks and troubleshooting guidance to keep your FastAPI + SQLAlchemy application fast and reliable.

Can I use SQLAlchemy with Alembic for schema versioning in PostgreSQL projects?

Yes. SQLAlchemy models integrate with Alembic to version and migrate PostgreSQL schemas automatically. This Skill covers writing models, generating migrations, and applying changes safely across development and production environments.

What constraints and indexes should I add to my PostgreSQL tables?

PostgreSQL constraints and indexes enforce data integrity and optimize query performance. This Skill guides you through designing primary keys, foreign keys, unique constraints, and strategic indexes for tables in FastAPI applications.

Why should I use transactions with READ COMMITTED isolation in PostgreSQL?

READ COMMITTED isolation prevents dirty reads while balancing concurrency in PostgreSQL. This Skill enforces it as a default transaction mode to ensure data consistency and safe concurrent operations in multi-user FastAPI applications.