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

[Databases support] Implement declarative base Model class #183

Open
1 task done
Tracked by #53
rszamszur opened this issue Jun 15, 2022 · 0 comments
Open
1 task done
Tracked by #53

[Databases support] Implement declarative base Model class #183

rszamszur opened this issue Jun 15, 2022 · 0 comments
Assignees
Labels
copier: project Related to copier template enhancement New feature or request

Comments

@rszamszur
Copy link
Member

rszamszur commented Jun 15, 2022

  • I have searched the issues of this repo and believe that this is not a duplicate.

Feature Request

In order to add support for databases with SQLAlchemy, a Base model class needs to be implemented from which concrete models will be inheriting.

Resources:

To think through:

  • How to implement SQLAlchemy session? A separate class that will be initialized on the FastAPI startup event handler and passed to the controller via FastAPI Depends() (or import). Or implemented into base model class.
  • How long keep an open session? Perpetual per worker? Or per request with context manager for db connection?
  • Implement dynamically generation of pydantic model classes for FastAPI endpoints (These Pydantic models define more or less a "schema" for endpoints to have common attributes while reading data.)? Or hard coded in separate files?

This still needs some more research and clarification.

@rszamszur rszamszur added the enhancement New feature or request label Jun 15, 2022
@rszamszur rszamszur self-assigned this Jun 15, 2022
@rszamszur rszamszur changed the title [Databases support] Implement SQLAlchemy Base model class [Databases support] Implement declarative base Model class Jun 21, 2022
@rszamszur rszamszur transferred this issue from fastapi-mvc/fastapi-mvc Sep 18, 2022
@rszamszur rszamszur transferred this issue from fastapi-mvc/cookiecutter Oct 9, 2022
@rszamszur rszamszur added the copier: project Related to copier template label Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
copier: project Related to copier template enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant