Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fastapi): refactored integration with CLI support #352

Merged
merged 7 commits into from
Jan 19, 2025
Merged

Conversation

cofin
Copy link
Member

@cofin cofin commented Jan 18, 2025

Refactored the Starlette and FastAPI integration to support multiple configurations and sessions. Additionally, FastAPI will now have the database commands automatically registered with the FastAPI CLI.

Copy link
Member Author

@cofin cofin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we re exporting these in fastapi? I don't think there is much convenience in doing from advanced_alchemy.fastapi import * over the normal from advanced_alchemy import *

It's for convenience so you don't need to import from several places with AA. It's done like this for Litestar and Flask as well.

Copy link
Member Author

@cofin cofin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you are using skip, you can probably move the fixture to a module level scope and remove decorating individual tests

pytestmark = pytest.mark.skipif(
    condition=sys.version_info < (3, 8),
    reason="Certain versions of Starlette and FastAPI are stated to still support 3.8, but there are documented incompatibilities on various versions that have not been yanked.  Skipping on 3.8 for now until this is resolved.",
)

It's probably important for me to point out that these are all of the existing test cases for starlette, not any that i've written yet.

Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/advanced-alchemy-docs-preview/352

@cofin cofin merged commit d51a0de into main Jan 19, 2025
21 checks passed
@cofin cofin deleted the fastapi-cli branch January 19, 2025 18:40
@cofin cofin linked an issue Jan 20, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Add support for the new FastApi Cli
3 participants