Deeply copies everything in the query object except the connection object is shared

def copy(self):
        """
        Deeply copies everything in the query object except the connection object is shared
        """
        connection = self.connection
        del self.connection
        copied_query = deepcopy(self)
        copied_query.connection = connection
        self.connection = connection
        return copied_query