I have created a Flask application using SQLAlchemy as the ORM. I also use flask-login to manage my different users. I want to connect to a PostgreSQL database with different flask users that correspond to different postgres users that have different privileges. They should be able to be logged in at the same time and make different queries with their individual rights. I tried all kinds of pooling methods by SQLAlchemy, but could not manage to achieve what I want. It always led to an arbitrary association of the open connections to the different users. What is the best way to do this, i.e. to achieve this kind of "session-persistent" database connection behaviour?
Thanks in advance for any help!