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

enh: Replace Peewee with SQLAlchemy due to multithreading issues #3228

Closed
jonathan-rohde opened this issue Jun 17, 2024 · 1 comment
Closed
Labels
core core feature enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@jonathan-rohde
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When using the application, the database connection gets still sooner or later. The root cause relies here in the multithreaded environment of FastAPI

Describe the solution you'd like
Replace Peewee ORM with SQLAlchemy

Describe alternatives you've considered
There exists a possibility to do an auto-reconnect for certain db related errors. But in my opinion this just hides the real issue. In some cases it might solve the users need, but it is not very reliable.
Additional there is a peewee-async project that can handle it. But reworking the backend to fit the async dependency is just at least the same effort as replacing it with SQLAlchemy. Considering if a library will be maintained in the future, I would rather bet with SQLAlchemy than peewee-async

Additional context
Screenshot 2024-06-17 at 10 42 21
tiangolo/fastapi#1019 (comment)

@tjbck
Copy link
Contributor

tjbck commented Jun 17, 2024

PR welcome!

@tjbck tjbck changed the title Replace Peewee with SQLAlchemy due to multithreading issues enh: Replace Peewee with SQLAlchemy due to multithreading issues Jun 17, 2024
@tjbck tjbck added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed core core feature labels Jun 18, 2024
@tjbck tjbck closed this as completed Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core core feature enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants