pir_pipeline.dashboard.db.get_db

pir_pipeline.dashboard.db.get_db()

Return a shared SQLAlchemyUtils object.

A single SQLAlchemyUtils (and its pooled engine) is created once per application and reused across requests, rather than rebuilt on every request. This avoids re-running driver detection and recreating the engine each time; SQLAlchemy’s engine is thread-safe and manages its own connection pool. A reference is also stashed on g for the current request so it can be released on teardown.