def _detect_database_platform(self):
        """
        Detects and sets the database platform.

        Evaluates custom platform class and version in order to set the correct platform.

        :raises InvalidPlatformSpecified: if an invalid platform was specified for this connection.
        """
        version = self._get_database_platform_version()

        if version is not None:
            self._platform = self._create_database_platform_for_version(version)
        else:
            self._platform = self.get_dbal_platform()
Detects and sets the database platform.

        Evaluates custom platform class and version in order to set the correct platform.

        :raises InvalidPlatformSpecified: if an invalid platform was specified for this connection.