removes an item from the db
333750
def delete_item(self, item):
        '''  '''
        for relation, dst in self.relations_of(item, True):
            self.delete_relation(item, relation, dst)
            #print(item, relation, dst)
        for src, relation in self.relations_to(item, True):
            self.delete_relation(src, relation, item)
            #print(src, relation, item)
        h = self._item_hash(item)
        if item in self:
            #print('deleting item:', item)
            self.nodes[h].clear()
            del self.nodes[h]
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)
906554
def delete(self, item, dry_run=None):
        """"""
        return self.backend.delete(item, dry_run=dry_run)
765949
function del(body, cb) {
  db.getClient(function(err, client, done) {
    client.query(DELETE, [body.post_id, body.tag_id], function(err, r) {
      if(err) {
        cb(err);
        done(err);
      } else {
        cb(null, r.rowCount);
        done();
      }
    });
  });
}
330316
def remove(item)
      prev_item = Soulmate.redis.hget(database, item["id"])
      if prev_item
        prev_item = MultiJson.decode(prev_item)
        # undo the operations done in add
        Soulmate.redis.pipelined do
          Soulmate.redis.hdel(database, prev_item["id"])
          phrase = ([prev_item["term"]] + (prev_item["aliases"] || [])).join(' ')
          prefixes_for_phrase(phrase).each do |p|
            Soulmate.redis.srem(base, p)
            Soulmate.redis.zrem("#{base}:#{p}", prev_item["id"])
          end
        end
      end
    end
532548
def delete(self, key):
        
        data = None
        if key is not None:
            data = self.db.delete(key.strip())
        else:
            self.tcex.log.warning(u'The key field was None.')
        return data
518239
def remove(self, key):
        """"""
        item = self.item_finder.pop(key)
        item[-1] = None
        self.removed_count += 1
315389
def remove(item):
    
    if os.path.isdir(item):
        shutil.rmtree(item)
    else:
        # Assume it's a file. error if not.
        os.remove(item)
964824
def db_remove(name, **connection_args):
    '''
    
    '''
    # check if db exists
    if not db_exists(name, **connection_args):
        log.info('DB \'%s\' does not exist', name)
        return False

    if name in ('mysql', 'information_scheme'):
        log.info('DB \'%s\' may not be removed', name)
        return False

    # db does exists, proceed
    dbc = _connect(**connection_args)
    if dbc is None:
        return False
    cur = dbc.cursor()
    s_name = quote_identifier(name)
    # identifiers cannot be used as values
    qry = 'DROP DATABASE {0};'.format(s_name)
    try:
        _execute(cur, qry)
    except MySQLdb.OperationalError as exc:
        err = 'MySQL Error {0}: {1}'.format(*exc.args)
        __context__['mysql.error'] = err
        log.error(err)
        return False

    if not db_exists(name, **connection_args):
        log.info('Database \'%s\' has been removed', name)
        return True

    log.info('Database \'%s\' has not been removed', name)
    return False
372386
public void doRemove() throws DBException
    {
        super.doRemove();
        if (m_arrayCache != null)
            if (m_iLogicalIndex != -1)
                m_arrayCache.set(m_iLogicalIndex, null);    // Show the current record as deleted.
    }
1148155
protected function cleanupMongoDB()
    {
        try {
            $this->dbh->drop();
        } catch (\MongoDB\Driver\Exception $e) {
            throw new \Exception(sprintf('Failed to drop the DB: %s', $e->getMessage()));
        }
    }
1192868
def purge(self, dbid):
        '''
        
        '''
        db_path = os.path.join(self.path, dbid)
        if os.path.exists(db_path):
            shutil.rmtree(db_path, ignore_errors=True)
            return True
        return False
129207
static function cleanup()
    {
        $db = eZDB::instance();
        $sql = "SELECT productcollection_id FROM ezbasket";
        $limit = self::ITEM_LIMIT;

        $db->begin();
        do
        {
            $rows = $db->arrayQuery( $sql, array( 'offset' => 0, 'limit' => $limit ) );

            if ( count( $rows ) == 0 )
                break;

            $productCollectionIDList = array();
            foreach ( $rows as $row )
            {
                $productCollectionIDList[] = (int)$row['productcollection_id'];
            }
            eZProductCollection::cleanupList( $productCollectionIDList );

            $ids = implode( ', ', $productCollectionIDList );
            $db->query( "DELETE FROM ezbasket WHERE productcollection_id IN ( $ids )" );
        }
        while ( true );
        $db->commit();
    }
788926
function removeItem(key, callback) {
        var self = this;

        // Cast the key to a string, as that's all we can set as a key.
        if (typeof key !== 'string') {
            window.console.warn(key +
                                ' used as a key, but it is not a string.');
            key = String(key);
        }

        var promise = new Promise(function(resolve, reject) {
            self.ready().then(function() {
                var dbInfo = self._dbInfo;
                localStorage.removeItem(dbInfo.keyPrefix + key);

                resolve();
            })["catch"](reject);
        });

        executeCallback(promise, callback);
        return promise;
    }
598194
def delete(self, key):
        """"""
        self._get_table()
        self.table.delete_item(key=key)
        log.debug("Deleted item at key '%s'" % (key))
195631
def remove(self, item, count=0):
        
        self._client.lrem(self.key_prefix, count, self._dumps(item))
797139
def delete(self,removed):
        
        sql = "DELETE FROM %s " %self.name
        if isinstance(removed,dict):
            # remove a single record
            _id = removed['__id__']
            sql += "WHERE rowid = ?"
            args = (_id,)
        else:
            # convert iterable into a list (to be able to sort it)
            removed = [ r for r in removed ]
            if not removed:
                return 0
            args = [ r['__id__'] for r in removed ]
            sql += "WHERE rowid IN (%s)" %(','.join(['?']*len(args)))
        self.cursor.execute(sql,args)
        return len(removed)