// DeleteKeyspace removes a keyspace from the database
193552
func (l *DB) DeleteKeyspace(name string) error {
    err := l.db.Update(func(tx *bolt.Tx) error {
        return tx.DeleteBucket([]byte(name))
    })
    return err
}
1135213
func (m *clusterQuotaMapper) removeNamespace(namespaceName string) {
	m.lock.Lock()
	defer m.lock.Unlock()

	delete(m.requiredNamespaceToLabels, namespaceName)
	delete(m.completedNamespaceToLabels, namespaceName)
	delete(m.namespaceToQuota, namespaceName)
	for quotaName, namespaces := range m.quotaToNamespaces {
		if namespaces.Has(namespaceName) {
			namespaces.Delete(namespaceName)
			for _, listener := range m.listeners {
				listener.RemoveMapping(quotaName, namespaceName)
			}
		}
	}
}
1021502
func (r *Service) Delete(key string) error {
	c := r.pool.Get()
	defer c.Close()

	_, err := c.Do("DEL", r.Config.Prefix+key)
	return err
}
314517
func (b *BoltKeyspace) Delete(key string) error {
    return b.db.Update(func(tx *bolt.Tx) error {
        b := tx.Bucket([]byte(b.name))
        return b.Delete([]byte(key))
    })
}
648141
func (db *DB) Delete(key []byte, wo *opt.WriteOptions) error {
	return db.putRec(keyTypeDel, key, nil, wo)
}
617493
func (fs *FSLocalKeyStore) DeleteKey(host string, username string) error {
	dirPath, err := fs.dirFor(host, false)
	if err != nil {
		return trace.Wrap(err)
	}
	files := []string{
		filepath.Join(dirPath, username+fileExtCert),
		filepath.Join(dirPath, username+fileExtTLSCert),
		filepath.Join(dirPath, username+fileExtPub),
		filepath.Join(dirPath, username),
	}
	for _, fn := range files {
		if err = os.Remove(fn); err != nil {
			return trace.Wrap(err)
		}
	}
	return nil
}
1213604
func (client *Client) DeleteKeyPairs(args *DeleteKeyPairsArgs) (err error) {
	response := common.Response{}
	err = client.Invoke("DeleteKeyPairs", args, &response)
	if err != nil {
		return err
	}
	return nil
}
814065
func (kv *KV) Delete(key []byte) error {
	return kv.db.Update(func(tx *bolt.Tx) error {
		return tx.Bucket(kv.table).Delete(key)
	})
}
331715
func (l *DB) GetOrCreateKeyspace(name string) (ks Keyspace, err error) {
    err = l.db.Update(func(tx *bolt.Tx) error {
        _, er := tx.CreateBucketIfNotExists([]byte(name))

        ks = &BoltKeyspace{name, l.db}
        return er
    })
    return ks, err
}
877500
func (q *Query) Keyspace() string {
	if q.session == nil {
		return ""
	}
	// TODO(chbannis): this should be parsed from the query or we should let
	// this be set by users.
	return q.session.cfg.Keyspace
}
359805
func (ts *Server) UpdateKeyspace(ctx context.Context, ki *KeyspaceInfo) error {
	// make sure it is locked first
	if err := CheckKeyspaceLocked(ctx, ki.keyspace); err != nil {
		return err
	}

	data, err := proto.Marshal(ki.Keyspace)
	if err != nil {
		return err
	}
	keyspacePath := path.Join(KeyspacesPath, ki.keyspace, KeyspaceFile)
	version, err := ts.globalCell.Update(ctx, keyspacePath, data, ki.version)
	if err != nil {
		return err
	}
	ki.version = version

	event.Dispatch(&events.KeyspaceChange{
		KeyspaceName: ki.keyspace,
		Keyspace:     ki.Keyspace,
		Status:       "updated",
	})
	return nil
}
380577
func ValidateKeyspace(input *vschemapb.Keyspace) error {
	_, err := BuildKeyspaceSchema(input, "")
	return err
}
194657
func (db *Database) Delete(key []byte) error {
	db.lock.Lock()
	defer db.lock.Unlock()

	if db.db == nil {
		return errMemorydbClosed
	}
	delete(db.db, string(key))
	return nil
}
842097
func (ddb debugDB) Delete(key []byte) {
	fmt.Printf("%v.Delete(%v)\n", ddb.label,
		cmn.ColoredBytes(key, cmn.Red, cmn.Yellow))
	ddb.db.Delete(key)
}
27651
func (b *Remote) DeleteWorkspace(name string) error {
	if b.workspace == "" && name == backend.DefaultStateName {
		return backend.ErrDefaultWorkspaceNotSupported
	}
	if b.prefix == "" && name != backend.DefaultStateName {
		return backend.ErrWorkspacesNotSupported
	}

	// Configure the remote workspace name.
	switch {
	case name == backend.DefaultStateName:
		name = b.workspace
	case b.prefix != "" && !strings.HasPrefix(name, b.prefix):
		name = b.prefix + name
	}

	client := &remoteClient{
		client:       b.client,
		organization: b.organization,
		workspace: &tfe.Workspace{
			Name: name,
		},
	}

	return client.Delete()
}
1235590
func (db *MemDB) Delete(key []byte) {
	db.mtx.Lock()
	defer db.mtx.Unlock()

	db.DeleteNoLock(key)
}
381249
func (s *spaceService) DeleteSpace(ctx context.Context, byIdentityID uuid.UUID, spaceID string) error {

	err := s.ExecuteInTransaction(func() error {
		// Check if the space exists first to make sure we return NotFoundError if it doesn't instead of Forbidden when checking permissions
		err := s.Repositories().ResourceRepository().CheckExists(ctx, spaceID)
		if err != nil {
			return err
		}
		err = s.Services().PermissionService().RequireScope(ctx, byIdentityID, spaceID, authorization.DeleteSpaceScope)
		if err != nil {
			return err
		}
		return s.Services().ResourceService().Delete(ctx, spaceID)
	})

	return err
}