async def upsert_through_instance(self, child: "T", **kwargs: Any) -> None:
        """
        Updates a through model instance in the database for m2m relations if
        it already exists, else creates one.

        :param kwargs: dict of additional keyword arguments for through instance
        :type kwargs: Any
        :param child: child model instance
        :type child: Model
        """
        try:
            await self.update_through_instance(child=child, **kwargs)
        except NoMatch:
            await self.create_through_instance(child=child, **kwargs)

        Updates a through model instance in the database for m2m relations if
        it already exists, else creates one.

        :param kwargs: dict of additional keyword arguments for through instance
        :type kwargs: Any
        :param child: child model instance
        :type child: Model
        
ormar/relations/querysetproxy.py