code: func (tx *Tx) DeleteAll() error {
  	if tx.db == nil {
  		return ErrTxClosed
  	} else if !tx.writable {
  		return ErrTxNotWritable
  	} else if tx.wc.itercount > 0 {
  		return ErrTxIterating
  	}
  
  	// check to see if we've already deleted everything
  	if tx.wc.rbkeys == nil {
  		// we need to backup the live data in case of a rollback.
  		tx.wc.rbkeys = tx.db.keys
  		tx.wc.rbexps = tx.db.exps
  		tx.wc.rbidxs = tx.db.idxs
  	}
  
  	// now reset the live database trees
  	tx.db.keys = btree.New(btreeDegrees, nil)
  	tx.db.exps = btree.New(btreeDegrees, &exctx{tx.db})
  	tx.db.idxs = make(map[string]*index)
  
  	// finally re-create the indexes
  	for name, idx := range tx.wc.rbidxs {
  		tx.db.idxs[name] = idx.clearCopy()
  	}
  
  	// always clear out the commits
  	tx.wc.commitItems = make(map[string]*dbItem)
  
  	return nil
  }
docs: // DeleteAll deletes all items from the database.