def configure_port_forwarding(graph): """ Bind the SQLAlchemy session context to Flask. The current session is available at `g.db.session`. """ return register_session_factory(graph, "forwarded_port", use_forwarded_port)
def configure_postgres_session_factory(graph): """ Binds the Postgres SQLAlchemy session context to Flask. :param graph: Instance of microcosm graph """ from microcosm_postgres.context import SessionContext return register_session_factory(graph, graph.config.postgres_session_factory.db_key, SessionContext.make)
def configure_session_factory(graph): """ Bind the SQLAlchemy session context to Flask. The current session is available at `g.db.session`. """ return register_session_factory(graph, "db", SessionContext.make)
def configure_session_factory(graph): return register_session_factory(graph, "db", SessionContext.make)