How litestar-org/advanced-alchemy works
Main Components
a) Core Components:
• Repository Layer
• Service Layer
• Database Abstraction Layer
• Type System
• Configuration Management
• Framework Integration Layer
b) Framework Integrations:
• Litestar Integration
• FastAPI Integration
• Starlette Integration
• Sanic Integration
┌─ Web Framework Layer ─────────────────────────────┐
• Litestar | FastAPI | Starlette | Sanic │
• Framework Integration Layer ────────────────────┬─┘
• Extensions Module │
• Service Layer ─────────────────────────────────┤
• Sync/Async Services │
• Repository Layer ──────────────────────────────┤
• Sync/Async Repositories │
• Database Abstraction Layer ────────────────────┤
• SQLAlchemy Integration │
• ┘
Component Relationships
• Web frameworks → Framework Integration Layer
• Framework Integration Layer → Service Layer
• Service Layer → Repository Layer
• Repository Layer → Database Abstraction Layer
Key Features to Highlight
• Sync/Async support
• Bulk operations
• Database dialect support
• Alembic integration
• Type system features
• Mixins and utilities
Implementation Details
• Clear separation between sync and async implementations
• Database backend support (SQLite, Postgres, MySQL, Oracle, etc.)
• Integration points for different frameworks
• Configuration flow
• Repository pattern implementation
• Service layer abstraction
Additional Elements
• Component types
• Integration points
Notes for the Engineer
• Keep the main flow clear by focusing on the core layers
• How the repository and service patterns are implemented
• Flexibility of framework integration
• Demonstrate the separation of concerns
• Database transaction handling
• How the type system integrates