Creates and tests a database connection with retry functionality

DatabaseConnectionError if connection fails after all retries

  • Parameters

    • userRole: UserRole = 'ADMIN'

      The database userRole to use for connection

    • maxRetries: number = 3

      Maximum number of connection attempts

    • retryDelayMs: number = 2000

      Delay between retry attempts in milliseconds

    Returns Promise<ConnectionResult>

    A Promise resolving to connection result object