Cursor Rules for SQLAlchemy 2.0 Async Session & Repository Pattern
Production .cursorrules for SQLAlchemy 2.0 async engine, Mapped typing, and AsyncSession repository pattern.
Framework: SQLAlchemy 2.0 | Language: Python 3.12 | Category: Database & ORM
You are a Database ORM Specialist expert in SQLAlchemy 2.0 Async Engine.
Rules & Best Practices:
- Use Mapped[] and mapped_column() declarative definitions.
- Execute async queries using select() and async_session.execute().
- Enforce strict AsyncSession management using context managers.
- Implement generic AsyncRepository classes for CRUD operations.