AS

async-sqlalchemy-patterns

Provides production-ready patterns for async database operations, ORM models, and migration workflows in FastAPI.

Install

mkdir -p .claude/skills/async-sqlalchemy-patterns && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14385" && unzip -o skill.zip -d .claude/skills/async-sqlalchemy-patterns && rm skill.zip

Installs to .claude/skills/async-sqlalchemy-patterns

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Async SQLAlchemy 2.0+ database patterns for FastAPI including session management, connection pooling, Alembic migrations, relationship loading strategies, and query optimization. Use when implementing database models, configuring async sessions, setting up migrations, optimizing queries, managing relationships, or when user mentions SQLAlchemy, async database, ORM, Alembic, database performance, or connection pooling.
421 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Advanced

Key capabilities

  • →Set up async database engines and session factories
  • →Manage database sessions using FastAPI dependency injection
  • →Implement base models with UUID primary keys and timestamps
  • →Configure Alembic for database migrations
  • →Optimize relationship loading with selectinload and joinedload
  • →Perform basic CRUD operations asynchronously

How it works

This skill configures SQLAlchemy 2.0+ for asynchronous operations within FastAPI, providing patterns for session management, model definition, and query optimization.

Inputs & outputs

You give it
Database URL, SQLAlchemy models, migration scripts
You get back
Configured async database connection, migrated schema, query results

When to use async-sqlalchemy-patterns

  • →Configure async SQLAlchemy sessions
  • →Set up Alembic migrations
  • →Optimize database model performance

About this skill

async-sqlalchemy-patterns

This page used to hold an archived copy of this skill. The archive now lives in the registry's data repository.

This pointer keeps old links working. It is not an installable skill.

When not to use it

  • →When working with synchronous database operations
  • →When the project does not use SQLAlchemy 2.0+ or FastAPI
  • →When a different ORM or database access layer is preferred

Limitations

  • →Requires SQLAlchemy 2.0+ for async features
  • →Optimizations like eager loading must be explicitly configured
  • →Troubleshooting N+1 problems requires SQL logging and specific loading strategies

How it compares

This approach provides structured patterns for async SQLAlchemy in FastAPI, including dependency injection and optimized relationship loading, which differs from manual setup that may lack these best practices.

Compared to similar skills

async-sqlalchemy-patterns side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
async-sqlalchemy-patterns (this skill)07moReviewAdvanced
supabase-python07moReviewAdvanced
junta-leiloeiros07moReviewIntermediate
DB Schema Surgeon09moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry