Advanced Alchemy
Code Style Rules
- Use
Mapped[...]for columns andT | Nonefor optional fields. - Keep business transformations in service lifecycle hooks.
- Prefer
SQLAlchemyAsyncRepositoryService[Model](infers a default repo) orSQLAlchemyAsyncRepositoryService[Model, CustomRepo](types custom repo methods) andadvanced_alchemy.*imports. - Use
from __future__ import annotationswhen it matches the project; 1.12+
supports it in model modules.
Match-Your-Framework — read first
advanced-alchemy ships first-party extensions for five web frameworks. If your project uses one of these, jump directly to the matching integration guide and skip the others: