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 Session class responsible for managing SQLAlchemy session #180

Open
1 task done
Tracked by #53
rszamszur opened this issue Jun 21, 2022 · 0 comments
Open
1 task done
Tracked by #53
Assignees
Labels
copier: project Related to copier template enhancement New feature or request

Comments

@rszamszur
Copy link
Member

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

Feature Request

This class will be responsible for managing SQLAlchemy engine connection and session.

To figure out/clarify:

  • What SQLAlchemy engine and session/sessionmaker parameters should be configurable for the user via pydantic BaseSettings configuration class.
  • How long keep an open session? Perpetual per worker? Or per request with a context manager?
  • Only implement async session or sync as well?
  • How to pass session to FastAPI controllers? Via FastAPI Depends()? Or just do plain import and access class variable for sessionmaker object instance?
  • How to handle different database engine hacks (for instance sqlite needs connect_args={"check_same_thread": False}). Might be useful: https://github.com/pallets-eco/flask-sqlalchemy/blob/e5bf821072de0d55ff92891432004322864a7265/src/flask_sqlalchemy/__init__.py#L888
  • ?
@rszamszur rszamszur added the enhancement New feature or request label Jun 21, 2022
@rszamszur rszamszur self-assigned this 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