Fallback for Postgresql DB in AsyncSession #1463
Replies: 2 comments
-
This is not about SQLModel actually but SQLAlchemy, your example also literally only imports sqlalchemy libs. Maybe you'll have better luck asking there or in StackOverflow with sqlalchemy tag. Am also interested in the answer though :) |
Beta Was this translation helpful? Give feedback.
-
I have tried to use asyncSession which import from sqlalchemy, and then the problem solved. I hope it is useful |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
I am currently having two Postgresql Clusters attached to my Python FastAPI server (see the source code).
Now assume, that the replica crashes. What would be the best strategy to redirect the traffic back to the primary?
I currently have tried this:
However, it used to throw Runtime errors? Hence, it would be great if you could give me some thoughts about it.
Operating System
macOS
Operating System Details
No response
SQLModel Version
0.0.8
Python Version
3.10
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions