Agent skill · software engineering · manutej
SQLAlchemy ORM Expert
Comprehensive SQLAlchemy skill for customer support tech enablement, covering ORM patterns, session management, query optimization, async operations, and PostgreSQL integration
Why this skill is useful
Provides specific ORM patterns and async operations for SQLAlchemy that enhance backend development in customer support applications.
What it needs
Requires alembic, asyncpg, psycopg2-binary, pytest, pytest-asyncio, sqlalchemy installed locally. About 7k tokens when loaded. Last updated 2026-06-13. 61 stars on the source repository.
What this skill does
SQLAlchemy ORM Expert Skill Overview This skill provides comprehensive guidance for using SQLAlchemy 2.0+ in customer support systems, focusing on ORM patterns, session management, query optimization, async operations with FastAPI, and PostgreSQL integration. It covers everything from basic model definitions to advanced patterns for high-performance support applications. Core Competencies 1. Customer Support Data Models When building customer support systems, you need robust data models that represent tickets, users, comments, attachments, and their relationships. SQLAlchemy's declarative mapping with type hints provides a clean, modern approach. Base Model Setup: User Model: Ticket Model: 2. Relationship Patterns One-to-Many (Comments on Tickets): Many-to-Many (Tags on Tickets): 3. Session Management Synchronous Session Setup: Async Session Setup for FastAPI: 4. Query Optimization and Eager Loading Avoiding N+1 Queries with Joined Load: Select In Load for Better Performance: 5. Complex Queries and Filters Advanced Filtering: 6. Aggregation Queries for Analytics Ticket Statistics: 7. Bulk Operations for Data Curation Bulk Insert: Bulk Update: 8. Soft Deletes and Audit Trails Soft Delete Implementation: `python async def softdeleteticket(session: AsyncSession, ticketid: int) -> bool: """ Soft delete a ticket by setting deletedat timestamp. """ stmt = ( update(Ticket) .where( and( Ticket.id == ticketid, Ticket.deletedat.is(None) ) ) .values(deletedat=func.now()) ) result = await session.execute(stmt) await session.commit() return result.rowcount > 0 async def restoreticket(session: AsyncSession, ticketid: int) -> bool: """ Restore a soft-deleted ticket. """ stmt = ( update(Tick
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills manutej/sqlalchemy