def METHOD_NAME(self, instance, validated_data):
    table = self.context['table']
    try:
        record = table.update_record(instance['id'], validated_data)
    except InvalidDate as e:
        raise database_api_exceptions.InvalidDateAPIException(
            e,
            status_code=status.HTTP_400_BAD_REQUEST
        )
    except InvalidDateFormat as e:
        raise database_api_exceptions.InvalidDateFormatAPIException(
            e,
            status_code=status.HTTP_400_BAD_REQUEST
        )
    except IntegrityError as e:
        if type(e.orig) is NotNullViolation:
            raise database_api_exceptions.NotNullViolationAPIException(
                e,
                status_code=status.HTTP_400_BAD_REQUEST,
                table=table
            )
        elif type(e.orig) is UniqueViolation:
            raise database_api_exceptions.UniqueViolationAPIException(
                e,
                message="The requested update violates a uniqueness constraint",
                table=table,
                status_code=status.HTTP_400_BAD_REQUEST,
            )
        elif type(e.orig) is CheckViolation:
            raise database_api_exceptions.CheckViolationAPIException(
                e,
                status_code=status.HTTP_400_BAD_REQUEST
            )
        else:
            raise database_api_exceptions.MathesarAPIException(e, status_code=status.HTTP_400_BAD_REQUEST)
    return record