Session_2 = sessionmaker(bind=some_engine_2)
session_1 = Session_1()
session_2 = Session_2()
Base = declarative_base()


class ModelBase(Base):
    master_query = session_1.query_property()
client_1_query = session_2.query_property()


class User(ModelBase):
    pass
User.master_query.filter(User.id == 1).all()
User.client_1_query.filter(User.id == 1).all()
Dynamically setting Flask-SQLAlchemy database connection in multi-tenant app