// OnDelete adds an ON DELETE clause to the foreign key
420811
func (fk ForeignKeyElem) OnDelete(b fkAction) ForeignKeyElem {
	fk.onDelete = &b
	return fk
}
818201
func (s *DB) Delete(value interface{}, where ...interface{}) *DB {
	return s.NewScope(value).inlineCondition(where...).callCallbacks(s.parent.callbacks.deletes).db
}
1315906
func (m *qryconn) Delete(key driver.Value) (int, error) {
	return -1, schema.ErrNotImplemented
}
1323916
func (db *DB) Delete(key []byte) (err error) {
	err = db.ldb.Delete(key, nil)
	if err != nil {
		metrics.GetOrRegisterCounter("DB.deleteFail", nil).Inc(1)
		return err
	}
	metrics.GetOrRegisterCounter("DB.delete", nil).Inc(1)
	return nil
}
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
}
1081480
func (f *FakeDeleter) Delete(name string) error {
	f.NsDeleted = append(f.NsDeleted, name)
	return f.Err
}
924576
func NoAutomaticSoftDelete() {
	if s, ok := relationalStoreDefinition(false); ok {
		s.NoAutoSoftDelete = true
	} else if m, ok := relationalModelDefinition(false); ok {
		delete(m.RelationalFields, "DeletedAt")
	}
}
1330610
func (db *Database) Delete(value DBModel) error {
	defer db.clear()
	// if Model has been called, skip table name inference procedure
	if len(db.tables) == 0 {
		db.tables = append(db.tables, handleIdentifier(value.TableName()))
		db.models = append(db.models, value)
	}

	// If where is empty, try to infer a primary key by value
	// otherwise buildDelete panics (where is mandatory)
	db = db.Where(value)

	// Compile query
	var stmt *sql.Stmt
	var err error
	if stmt, err = db.db.Prepare(db.buildDelete()); err != nil {
		return err
	}

	// Pass query parameters and executes the query
	if _, err = stmt.Exec(db.whereValues...); err != nil {
		return err
	}

	// Clear fields of value after delete, because the object no more exists
	value = reflect.Zero(reflect.ValueOf(value).Type()).Interface().(DBModel)

	return nil
}
1077641
func (db *sqlDB) Delete(m Model, id string) error {
	stmt, err := db.stmts.Stmt(m)
	if err != nil {
		return err
	}

	r, err := stmt.Delete.Exec(id)
	if err != nil {
		return err
	}

	if affected, _ := r.RowsAffected(); affected == 0 {
		return ErrNoRows
	}

	return nil
}
63549
func (pdb *prefixDB) Delete(key []byte) {
	pdb.mtx.Lock()
	defer pdb.mtx.Unlock()

	pdb.db.Delete(pdb.prefixed(key))
}
1014333
func (tx *bytesTxn) Delete(key string) keyval.BytesTxn {
	tx.ops = append(tx.ops, clientv3.OpDelete(key))
	return tx
}
425607
func (db *ProtoWrapper) Delete(key string, opts ...datasync.DelOption) (existed bool, err error) {
	return db.broker.Delete(key, opts...)
}
724888
func (db *Database) Delete(sid string, key string) (deleted bool) {
	err := db.redis.Delete(makeKey(sid, key))
	if err != nil {
		golog.Error(err)
	}
	return err == nil
}
1006299
func (db *CLevelDB) Delete(key []byte) {
	key = nonNilBytes(key)
	err := db.db.Delete(db.wo, key)
	if err != nil {
		panic(err)
	}
}
501242
func (kv *KV) Delete(key []byte) error {
	return kv.db.Erase(gkv.Btos(key))
}
83594
func (q *ModelQuery) Delete() error {
	if q.lastError != nil {
		return q.lastError
	}
	pk := q.model.pk()
	if len(pk) == 0 {
		return MissingPKError
	}
	_, err := q.builder.Delete(q.model.tableName, HashExp(pk)).WithContext(q.ctx).Execute()
	return err
}
192008
func (f *FakeControllerSource) Delete(lastValue runtime.Object) {
	f.Change(watch.Event{Type: watch.Deleted, Object: lastValue}, 1)
}