// Drop empties the database if del is false.  Drop deletes and closes the
// database if del is true.
//
// See mdb_drop.
499722
func (txn *Txn) Drop(dbi DBI, del bool) error {
	ret := C.mdb_drop(txn._txn, C.MDB_dbi(dbi), cbool(del))
	return operrno("mdb_drop", ret)
}
1288482
func (d *DataBagService) Delete(name string) (result *DataBag, err error) {
	path := fmt.Sprintf("data/%s", name)
	err = d.client.magicRequestDecoder("DELETE", path, nil, &result)
	return
}
1248508
func (self *Model) Delete(ids ...interface{}) error {
	return self.db.Delete(self.collection.Name, ids...)
}
1038918
func (b *BaseBuilder) Delete(table string, where Expression) *Query {
	sql := "DELETE FROM " + b.db.QuoteTableName(table)
	params := Params{}
	if where != nil {
		w := where.Build(b.db, params)
		if w != "" {
			sql += " WHERE " + w
		}
	}
	return b.NewQuery(sql).Bind(params)
}
969307
func DropDB(c *Connection) error {
	deets := c.Dialect.Details()
	if deets.Database != "" {
		log(logging.Info, fmt.Sprintf("drop %s (%s)", deets.Database, c.URL()))
		return errors.Wrapf(c.Dialect.DropDB(), "couldn't drop database %s", deets.Database)
	}
	return nil
}
819445
func (c *Cache) Delete(key string) {
	c.db.Delete([]byte(key), nil)
}
868307
func (c *C) Drop() error {
	c.m.Lock()
	defer c.m.Unlock()
	c.close()
	if err := os.Remove(c.path); err != nil {
		// ignore not exist errors - they're fine
		if !os.IsNotExist(err) {
			return err
		}
	}
	return nil
}
1112067
func (db *DB) Delete(opts *WriteOptions, key []byte) error {
	var (
		cErr *C.char
		cKey = byteToChar(key)
	)
	C.rocksdb_delete(db.c, opts.c, cKey, C.size_t(len(key)), &cErr)
	if cErr != nil {
		defer C.free(unsafe.Pointer(cErr))
		return errors.New(C.GoString(cErr))
	}
	return nil
}
179133
func (db *DB) Close() {
	if db.closed {
		return
	}

	db.closed = true
	C.leveldb_close(db.Ldb)
}
1114618
func (rdb RethinkDB) Delete(gun data.GUN) error {
	resp, err := gorethink.DB(rdb.dbName).Table(RDBTUFFile{}.TableName()).GetAllByIndex(
		"gun", gun.String(),
	).Delete().RunWrite(rdb.sess)
	if err != nil {
		return fmt.Errorf("unable to delete %s from database: %s", gun.String(), err.Error())
	}
	if resp.Deleted > 0 {
		return rdb.writeChange(gun.String(), 0, "", changeCategoryDeletion)
	}
	return nil
}
382092
func (db *Database) Delete(sid string, key string) (deleted bool) {
	err := db.Service.Update(func(tx *bolt.Tx) error {
		b := db.getBucketForSession(tx, sid)
		if b == nil {
			return sessions.ErrNotFound
		}

		return b.Delete(makeKey(key))
	})

	return err == nil
}
755977
func (s *Stack) Drop() error {
	if err := s.Close(); err != nil {
		return err
	}

	return os.RemoveAll(s.DataDir)
}
1272284
func (db *Database) Clear(sid string) {
	db.Service.Update(func(tx *bolt.Tx) error {
		b := db.getBucketForSession(tx, sid)
		if b == nil {
			return nil
		}

		return b.ForEach(func(k []byte, v []byte) error {
			return b.Delete(k)
		})
	})
}
639078
func (db *DB) Delete(doc *Doc) error {
	if doc.ID == 0 {
		return fmt.Errorf("doc never written")
	}

	tx, err := db.meta.Begin()
	if err != nil {
		return err
	}
	defer tx.Rollback() // no-op after Commit

	if err := db.store.Delete(tx, doc); err != nil {
		return err
	}
	txt := text{ID: doc.ID}
	if err := db.store.Delete(tx, &txt); err != nil {
		return err
	}

	err = tx.Commit()
	if err != nil {
		return err
	}

	return nil
}
1165083
func Drop(in interface{}, n int) interface{} {
	value := reflect.ValueOf(in)
	valueType := value.Type()

	kind := value.Kind()

	if kind == reflect.Array || kind == reflect.Slice {
		length := value.Len()

		resultSlice := makeSlice(value, length-n)

		j := 0
		for i := n; i < length; i++ {
			resultSlice.Index(j).Set(value.Index(i))
			j++
		}

		return resultSlice.Interface()

	}

	panic(fmt.Sprintf("Type %s is not supported by Drop", valueType.String()))
}
31269
func (db *Database) clear() {
	db.rawRows = nil
	db.tables = nil
	db.joinTables = nil
	db.models = nil
	db.cteSelectValues = nil
	db.cte = ""
	db.selectFields = ""
	db.updateCreateValues = nil
	db.updateCreateFields = nil
	db.whereValues = nil
	db.whereFields = nil
	db.order = ""
	db.limit = 0
	db.offset = 0
	db.varCount = 1
}
1267711
func (db *DB) Delete(name []byte) error {
	return db.Update(func(tx *bolt.Tx) error {
		return tx.DeleteBucket(name)
	})
}