Function to create a new MySQL connection pool with the given user role.

This function performs the following operations:

  1. Determines the user and password for the database connection based on the user role.
  2. Creates a new MySQL connection pool with the determined user and password, and the database details from the environment variables.

The connection pool is configured to wait for connections if they are all in use, and has a connection limit of 10000 and a queue limit of 0.

Will throw an error if the user role is invalid.

  • Parameters

    • userRole: UserRole

      The role of the user for the database connection.

    Returns Pool

    The created MySQL connection pool.