code: def _detect_database_platform(self):
          
          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()
docs: 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.