sqlalchemy-orm

Model and query relational data with SQLAlchemy ORM in Python.

4|Updated Feb 20, 2026
One-click install
npx skills add https://github.com/FEMADOX/Fastapi-Ecosystem-Lab --skill sqlalchemy-orm-femadox
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlalchemy-orm
Source: https://github.com/FEMADOX/Fastapi-Ecosystem-Lab/tree/main/.agents/skills/sqlalchemy
Command: npx skills add https://github.com/FEMADOX/Fastapi-Ecosystem-Lab --skill sqlalchemy-orm-femadox

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlines building reliable relational data models in Python by providing a modern ORM with declarative mappings, relationships, and migrations.

Core Features & Use Cases

  • Declarative models with type hints and relationships (one-to-many, many-to-many) for clear, maintainable schemas.
  • Integrated migrations with Alembic to evolve database schemas safely.
  • Async support via AsyncSession for modern async web frameworks like FastAPI.

Quick Start

Create a minimal SQLAlchemy model, configure an engine and session, and run a simple query to validate your setup.

Frequently Asked Questions about sqlalchemy-orm

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

FAQPage Schema
How do I define async SQLAlchemy ORM models for a FastAPI application?

Define async SQLAlchemy ORM models for FastAPI using declarative base mappings with type hints and manage connections via AsyncSession. This approach streamlines building reliable relational data models and integrates smoothly with modern async web frameworks.

What is the best way to handle database migrations with SQLAlchemy models?

Handle database migrations with SQLAlchemy models by integrating Alembic to evolve database schemas safely. This allows you to apply and rollback relational database changes without manually writing SQL migration scripts.

Can I use SQLAlchemy ORM to configure one-to-many and many-to-many relationships?

Yes, you can use SQLAlchemy ORM to configure one-to-many and many-to-many relationships. It provides declarative model definitions with explicit relationship mappings to create clear, maintainable schemas for relational databases like PostgreSQL and MySQL.

Does SQLAlchemy ORM work with both sync and async database sessions?

SQLAlchemy ORM works with both sync and async database access patterns. You can use standard sessions for traditional Flask or Django projects, and AsyncSession for modern async frameworks like FastAPI to query relational data.

How do I query relational data using the modern SQLAlchemy select() statement?

Query relational data using the modern SQLAlchemy select() statement to build type-safe queries. This method replaces legacy Query API calls, providing a cleaner interface to retrieve and filter records across your declared ORM models.