advanced-alchemy-litestar
Installation
SKILL.md
Litestar
Execution Workflow
- Configure
SQLAlchemyAsyncConfigorSQLAlchemySyncConfigand registerSQLAlchemyPlugin. - Use the plugin to provide session and engine dependencies instead of hand-rolling request-scoped session management.
- Build controllers around services first, and fall back to repository-only patterns only when they stay simpler.
- Keep application composition in
Litestar(...)and let providers or DI supply services. - Enable CLI database commands and optional session-backend support only after the core CRUD path is stable.
Implementation Rules
- Prefer a single canonical plugin configuration per application.
- Keep
before_send_handlerand session dependency keys explicit when changing defaults. - Use controller or handler injection for
db_sessiononly when service injection is unnecessary. - Keep DTO or schema shaping close to the controller boundary, not inside repositories.