advanced-alchemy

Installation
SKILL.md

Advanced Alchemy

Code Style Rules

  • Use Mapped[...] for columns and T | None for optional fields.
  • Keep business transformations in service lifecycle hooks.
  • Prefer the inner Repo service pattern and advanced_alchemy.* imports.
  • Use from __future__ import annotations when it matches the project; 1.11 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:

  • LitestarSQLAlchemyPlugin with full DI, session store, CLI. The rest of this SKILL.md covers Litestar by default; also see references/litestar_plugin.md.
  • FastAPIreferences/fastapi-integration.mdAdvancedAlchemy(config=..., app=app), Depends(alchemy.provide_session()) DI, provide_service()/provide_filters(), Alembic CLI via assign_cli_group.
  • Flaskreferences/flask-integration.mdAdvancedAlchemy(config=..., app=app) or init_app() factory, pull-based alchemy.get_sync_session(), async-via-portal.
  • Sanicreferences/sanic-integration.mdAdvancedAlchemy(sqlalchemy_config=..., sanic_app=app) (note: sqlalchemy_config= kwarg, not config=), sanic-ext DI, request.ctx sessions.
  • Starlettereferences/starlette-integration.mdAdvancedAlchemy(config=..., app=app), request.state session access, lifespan wrapping.
Installs
9
GitHub Stars
13
First Seen
May 27, 2026
advanced-alchemy — litestar-org/litestar-skills