Originally created by @jonathan-rohde on GitHub (Jun 17, 2024).
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
Originally created by @jonathan-rohde on GitHub (Jun 17, 2024).
**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**

https://github.com/tiangolo/fastapi/issues/1019#issuecomment-612921599
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @jonathan-rohde on GitHub (Jun 17, 2024).
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

https://github.com/tiangolo/fastapi/issues/1019#issuecomment-612921599
@tjbck commented on GitHub (Jun 17, 2024):
PR welcome!