advanced-alchemy-flask

- Choose SQLAlchemySyncConfig by default, or SQLAlchemyAsyncConfig only when Flask async routes are intentional and supported.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "advanced-alchemy-flask" with this command: npx skills add alti3/litestar-skills/alti3-litestar-skills-advanced-alchemy-flask

Flask

Execution Workflow

  • Choose SQLAlchemySyncConfig by default, or SQLAlchemyAsyncConfig only when Flask async routes are intentional and supported.

  • Initialize AdvancedAlchemy with the app and use its session helpers rather than global engine state.

  • Use bind_key only when the application truly needs multiple databases.

  • Wrap CRUD-heavy services with FlaskServiceMixin when its jsonify() helper meaningfully simplifies responses.

  • Use flask database commands once migrations are wired through the extension.

Implementation Rules

  • Keep commit_mode explicit: manual , autocommit , or autocommit_include_redirect .

  • Prefer request or app-context-managed sessions over module-level state.

  • Translate Flask query params into Advanced Alchemy filters near the route boundary.

  • Use async sessions in sync routes only with care; that path is documented as experimental.

Example Pattern

from advanced_alchemy.extensions.flask import AdvancedAlchemy, SQLAlchemySyncConfig from flask import Flask

app = Flask(name) alchemy = AdvancedAlchemy( SQLAlchemySyncConfig(connection_string="sqlite:///local.db", commit_mode="autocommit"), app, )

Validation Checklist

  • Confirm sessions are opened inside request or app context and closed cleanly.

  • Confirm the chosen commit mode matches endpoint behavior, including redirects if relevant.

  • Confirm flask database --help exposes migration commands when expected.

  • Confirm FlaskServiceMixin.jsonify() returns the intended serialization format.

Cross-Skill Handoffs

  • Use advanced-alchemy-repositories and advanced-alchemy-services for the persistence layer itself.

  • Use advanced-alchemy-cli for migration command semantics behind Flask CLI wrappers.

  • Use advanced-alchemy-database-seeding for fixture loading during app initialization or admin workflows.

Advanced Alchemy References

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

litestar-authentication

No summary provided by upstream source.

Repository SourceNeeds Review
General

litestar-routing

No summary provided by upstream source.

Repository SourceNeeds Review
General

litestar-testing

No summary provided by upstream source.

Repository SourceNeeds Review
General

litestar-databases

No summary provided by upstream source.

Repository SourceNeeds Review