class_docstr: Base class for to create DBClients for engines supported by SQLAlchemy.
class_docstr_tok: ["Base","class","for","to","create","DBClients","for","engines","supported","by","SQLAlchemy","."]
code: def create_engine(  # noqa: D
      dialect: str,
      port: int,
      database: str,
      username: str,
      password: str,
      host: str,
      driver: Optional[str] = None,
      query: Optional[Mapping[str, Union[str, Sequence[str]]]] = None,
  ) -> sqlalchemy.engine.Engine:
      connect_url = SqlAlchemySqlClient.build_engine_url(
          dialect=dialect,
          driver=driver,
          username=username,
          password=password,
          host=host,
          port=port,
          database=database,
          query=query,
      )
      # Without pool_pre_ping, it's possible for timed-out connections to be returned to the client and cause errors.
      # However, this can cause increase latency for slow engines.
      return sqlalchemy.create_engine(
          connect_url,
          pool_size=10,
          max_overflow=10,
          pool_pre_ping=True,
      )
  
imports: from __future__ import annotations
  import logging
  import time
  from abc import ABC
  from contextlib import contextmanager
  from typing import Iterator, Mapping, Optional, Sequence, Set, Union
  import pandas
  import sqlalchemy
  from metricflow.dataflow.sql_table import SqlTable
  from metricflow.sql.sql_bind_parameters import SqlBindParameters
  from metricflow.sql_request.sql_request_attributes import SqlJsonTag, SqlRequestTagSet
  from metricflow.test.fixtures.sql_clients.base_sql_client_implementation import BaseSqlClientImplementation
label_desc: Use image node_id 3 for calling the SqlAlchemySqlClient obj's underlying member method code with example usage: obj.create_engine(dialect, port, database, username, password, host, driver, query) and returns: sqlalchemy