title: SQLAlchemy engine from Airflow database hook
body: <p>What's the best way to get a SQLAlchemy engine from an Airflow connection ID?</p>
  
  <p>Currently I am creating a hook, retrieving its URI, then using it to create a SQLAlchemy engine.</p>
  
  <pre class="lang-py prettyprint-override"><code>postgres_hook = PostgresHook(self.postgres_conn_id)
  engine = create_engine(postgres_hook.get_uri())
  </code></pre>
  
  <p>This works but both commands make a connection to the database.</p>
  
  <p>When I have "extra" parameters on the connection a third connection is needed to retrieve those (see <a href="https://stackoverflow.com/questions/61528418/retrieve-full-connection-uri-from-airflow-postgres-hook">Retrieve full connection URI from Airflow Postgres hook</a>)</p>
  
  <p>Is there a shorter and more direct method?</p>