SQLAlchemy ORM Patterns

•
6
•

Implements modern SQLAlchemy 2.0+ patterns for robust Python database access and ORM management.

This skill provides specialized guidance for implementing modern SQLAlchemy 2.0+ ORM patterns within Python applications. It equips Claude with the ability to define type-safe models using Mapped and mapped_column, manage database sessions effectively, and construct optimized queries. It specifically addresses advanced use cases such as PostgreSQL upserts, complex model relationships, and JSON column manipulation, ensuring that your database layer is consistent, maintainable, and follows current industry best practices.

주요 기능

016 GitHub stars
02PostgreSQL-specific upsert (ON CONFLICT) implementation
03Structured JSON column mapping and querying
04Type-safe SQLAlchemy 2.0 model definitions using Mapped and mapped_column
05Standardized session management and lifecycle patterns
06Advanced query construction, filtering, and scalar execution

사용 사례

01Implementing complex data relationships and document-style storage in SQL
02Migrating legacy SQLAlchemy 1.x codebases to modern 2.0 syntax
03Building scalable Python backends with type-safe database layers