Parameters:
     - db_name
     - tbl_name
     - part_name
     - deleteData
     - environment_context
424088
def drop_partition_by_name_with_environment_context(self, db_name, tbl_name, part_name, deleteData, environment_context):
    
    self.send_drop_partition_by_name_with_environment_context(db_name, tbl_name, part_name, deleteData, environment_context)
    return self.recv_drop_partition_by_name_with_environment_context()
1323555
public function cmdDeleteDatabase()
    {
        $table = $this->getParam(0);
        $conditions = $this->getOptions();

        if (empty($table) || empty($conditions)) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (!$this->db->delete($table, $conditions)) {
            $this->errorAndExit($this->text('An error occurred'));
        }

        $this->output();
    }
1237815
def _remove_bdb_context(evalue):
        
        removed_bdb_context = evalue
        while removed_bdb_context.__context__:
            ctx = removed_bdb_context.__context__
            if (
                isinstance(ctx, AttributeError)
                and ctx.__traceback__.tb_frame.f_code.co_name == "onecmd"
            ):
                removed_bdb_context.__context__ = None
                break
            removed_bdb_context = removed_bdb_context.__context__
729676
def teardown_databases(self, old_config, options):
        
        if len(old_config) > 1:
            old_names, mirrors = old_config
        else:
            old_names = old_config
        for connection, old_name, destroy in old_names:
            if destroy:
                connection.creation.destroy_test_db(old_name, options['verbosity'])
892738
def stopContext(self, context):
        

        # Use pymongo directly to drop all collections of created db
        if ((self.clear_context['module'] and inspect.ismodule(context)) or
           (self.clear_context['class'] and inspect.isclass(context))):
            self.connection.drop_database(self.database_name)
1217245
def _delete_null_columns(self):
        
        ds = DeleteStatement(self.column_family_name)
        deleted_fields = False
        for _, v in self.instance._values.items():
            col = v.column
            if v.deleted:
                ds.add_field(col.db_field_name)
                deleted_fields = True
            elif isinstance(col, Map):
                uc = MapDeleteClause(col.db_field_name, v.value, v.previous_value)
                if uc.get_context_size() > 0:
                    ds.add_field(uc)
                    deleted_fields = True

        if deleted_fields:
            for name, col in self.model._primary_keys.items():
                ds.add_where_clause(WhereClause(
                    col.db_field_name,
                    EqualsOperator(),
                    col.to_database(getattr(self.instance, name))
                ))
            self._execute(ds)
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])
330974
function dropEnvironmentDatabase(domain, env, next) {
  _getEnvironmentDatabase({
    domain: domain,
    environment: env
  }, function (err, found) {
    if (err) {
      return next(common.buildErrorObject({
        err: err,
        msg: 'Failed to get environment',
        httpCode: 500
      }));
    }
    if (!found) {
      log.logger.info("no environment db for " + env + " moving on");
      return next();
    }
    found.dropDb(config.getConfig(), function dropped(err) {
      if (err) {
        log.logger.error('Failed to delete model');
        return next(common.buildErrorObject({
          err: err,
          msg: 'Failed to drop environment db',
          httpCode: 500
        }));
      }
      found.remove(next);
    });
  });
}
426654
def get_partition_names(self, db_name, tbl_name, max_parts):
    
    self.send_get_partition_names(db_name, tbl_name, max_parts)
    return self.recv_get_partition_names()
826457
def dbRestore(self, db_value, context=None):
        
        if db_value is not None:
            jdata = super(QueryColumn, self).dbRestore(db_value, context=context)
            return orb.Query.fromJSON(jdata)
        else:
            return db_value
39874
def purge(self):
        '''
        
        '''
        for table_name in self._db.list_tables():
            self._db.flush(table_name)

        self._run_init_queries()
874699
def delete(self, instance):
        
        
        #TODO: Really drop the database based on a policy set in `instance.parameters`.
        #
        #      We need :
        #      - Set a policy in parameters of the instance (eg: policy-on-delete : retain|drop    => default to retain)
        #      - to check that the database name `instance.get_dbname()` is not in use by another instance (shared database)
        #      - credential on the Atlas cluster `instance.get_cluster()` to drop the database
        #
        
        self.backend.storage.remove(instance)
        
        return DeprovisionServiceSpec(False, "done")
1215545
def DeleteDatabase(self, database_link, options=None):
        
        if options is None:
            options = {}

        path = base.GetPathFromLink(database_link)
        database_id = base.GetResourceIdOrFullNameFromLink(database_link)
        return self.DeleteResource(path,
                                   'dbs',
                                   database_id,
                                   None,
                                   options)
1037136
def delete_joined_table_sql(qualified_name, removing_qualified_name, primary_key):
    

    condition_template = 't.{}=d.{}'
    where_clause = ' AND '.join(condition_template.format(pkey, pkey)
                                for pkey in primary_key)
    delete_statement = (
        'DELETE FROM {table} t'
        ' USING {delete_table} d'
        ' WHERE {where_clause}').format(table=qualified_name,
                                        delete_table=removing_qualified_name,
                                        where_clause=where_clause)
    return delete_statement
294128
def DbDeleteDeviceAttribute(self, argin):
        
        self._log.debug("In DbDeleteDeviceAttribute()")

        if len(argin) < 2:
            self.warn_stream("DataBase::db_delete_device_attribute(): insufficient number of arguments ")
            th_exc(DB_IncorrectArguments,
                   "insufficient number of arguments to delete device attribute",
                   "DataBase::DeleteDeviceAttribute()")

        dev_name, attr_name = argin[:2]

        ret, dev_name, dfm = check_device_name(argin)
        if not ret:
            self.warn_stream("DataBase::db_delete_device_attribute(): device name " + argin + " incorrect ")
            th_exc(DB_IncorrectDeviceName,
                   "failed to delete device attribute, device name incorrect",
                   "DataBase::DeleteDeviceAttribute()")

        self.db.delete_device_attribute(dev_name, attr_name)
506252
def DbDeleteServerInfo(self, argin):
        
        self._log.debug("In DbDeleteServerInfo()")
        self.db.delete_server_info(argin)
976946
def drop_all(self):
        '''  '''
        self.drop(self.get_table_names())
        if self.persistent:
            with self._lock:
                try:
                    dbfolder = os.path.join(self.root_dir, self.name)
                    if os.path.exists(dbfolder) and not os.listdir(dbfolder):
                        rmtree(dbfolder)
                except (IOError, WindowsError):
                    self._print('Failed to delete folder %s when dropping database' % self.name)
                finally:
                    del self