def create_database_engine(user, password, database, host, port):
    """Create a database engine"""

    driver = 'mysql+pymysql'
    url = URL(driver, user, password, host, port, database,
              query={'charset': 'utf8mb4'})
    return create_engine(url, poolclass=QueuePool,
                         pool_size=25, pool_pre_ping=True,
                         echo=False)
Create a database engine