code: func (tx *Tx) rollbackInner() {
  	// rollback the deleteAll if needed
  	if tx.wc.rbkeys != nil {
  		tx.db.keys = tx.wc.rbkeys
  		tx.db.idxs = tx.wc.rbidxs
  		tx.db.exps = tx.wc.rbexps
  	}
  	for key, item := range tx.wc.rollbackItems {
  		tx.db.deleteFromDatabase(&dbItem{key: key})
  		if item != nil {
  			// When an item is not nil, we will need to reinsert that item
  			// into the database overwriting the current one.
  			tx.db.insertIntoDatabase(item)
  		}
  	}
  	for name, idx := range tx.wc.rollbackIndexes {
  		delete(tx.db.idxs, name)
  		if idx != nil {
  			// When an index is not nil, we will need to rebuilt that index
  			// this could be an expensive process if the database has many
  			// items or the index is complex.
  			tx.db.idxs[name] = idx
  			idx.rebuild()
  		}
  	}
  }
docs: // rollbackInner handles the underlying rollback logic.
  // Intended to be called from Commit() and Rollback().