Removes rows from the table.
        
        :Parameters: 

        - query(dict), specify the WHERE clause

        :Return: Number of rows deleted
491053
def remove(self, filter=None):
        
        sql = build_delete(table_name=self.name, condition=filter)
        return self.cursor.execute(sql)
1294969
def filter(self, criteria: Q, offset: int = 0, limit: int = 10,
               order_by: list = ()) -> ResultSet:
        
1111738
def query_delete(cls, expression=None):
        
        if expression is not None:
            executor = Executor(cls.__database__)
            result = executor.execute(expression)
        else:
            result = cls._query.all_index()

        for hash_id in result:
            cls.load(hash_id, convert_key=False).delete()
706182
def get_count_query(self):
        
        query_copy = self.copy()
        if not query_copy.tables:
            raise Exception('No tables specified to do a count')

        for table in query_copy.tables:
            del table.fields[:]

        query_copy.tables[0].add_field(CountField('*'))
        del query_copy.sorters[:]
        return query_copy
701385
def delete_by_field(self, table: str, field: str, value: Any) -> int:
        """"""
        sql = ("DELETE FROM " + self.delimit(table) +
               " WHERE " + self.delimit(field) + "=?")
        return self.db_exec(sql, value)
189734
def delete(self):
        
        cmd = "delete from {table} {where_clause}".format(
            table=self.table_name,
            where_clause=self.where_clause
        ).rstrip()
        Repo.db.execute(cmd, self.where_values)
1183278
def delete_many(self, query):
        
        items = self.find(query)
        result = [
            self.table.remove(where(u'_id') == item[u'_id'])
            for item in items
        ]

        if query == {}:
            # need to reset TinyDB's index for docs order consistency
            self.table._last_id = 0

        return DeleteResult(raw_result=result)
788381
def execute(query, data=None):
    
    connection = _State.connection()
    _State.new_transaction()

    if data is None:
        data = []

    result = connection.execute(query, data)

    _State.table = None
    _State.metadata = None
    try:
        del _State.table_pending
    except AttributeError:
        pass

    if not result.returns_rows:
        return {u'data': [], u'keys': []}

    return {u'data': result.fetchall(), u'keys': list(result.keys())}
850597
def delete_row(self, index):
        
        url = self.build_url(self._endpoints.get('delete_row').format(id=index))
        return bool(self.session.post(url))
853860
def delete(self, table, where, values = ()) :
		""""""
		sql = 'DELETE FROM %s WHERE %s' % (table, where)
		return self.execute(sql, values)
976636
def clear(self):
        """"""
        WhereQuery.clear(self)
        self._table = None
        self._parameters = []
        self._sql = None
1023275
def filter(self, *args, **kwargs):
		""""""
		if 'pk' in kwargs or 'id' in kwargs:
			return self.all_with_deleted().filter(*args, **kwargs)
		return self.get_query_set().filter(*args, **kwargs)
1315863
def query(self, query):
        
        if query is None:
            raise ValueError("Invalid value for `query`, must not be `None`")
        if query is not None and len(query) > 1000:
            raise ValueError("Invalid value for `query`, length must be less than or equal to `1000`")

        self._query = query
1370516
def delete(self):
        

        if not HAS_SQL:  # pragma: nocover
            return
        try:
            conn, c = self.connect()
            c.execute('DELETE FROM {0}'.format(self.table_name))
            conn.commit()
            conn.close()
        except:
            log.traceback(logging.DEBUG)
334658
def delete_garbage(self):
        
        self.connection.query(
            "DELETE FROM `{db}`.`{tab}` WHERE ".format(tab=self.table_name, db=self.database) +
            " AND ".join(
                'hash NOT IN (SELECT {column_name} FROM {referencing_table})'.format(**ref)
                for ref in self.references) or "TRUE")
        print('Deleted %d items' % self.connection.query("SELECT ROW_COUNT()").fetchone()[0])
1015699
def filter_query(self, query):
        

        for filter_class in list(self.filter_classes):
            query = filter_class().filter_query(self.request, query, self)

        return query
199529
def remove(self, key):
        '''
        
        '''
        encodedKey = json.dumps(key)
        sql = 'DELETE FROM ' + self.table + ' WHERE name = %s'
        with self.connect() as conn:
            with doTransaction(conn):
                return executeSQL(conn, sql, args=[encodedKey])