// ForceDelete force deletes a given model from the db
337610
func ForceDelete(db DB, model interface{}) error {
	res, err := NewQuery(db, model).WherePK().ForceDelete()
	if err != nil {
		return err
	}
	return internal.AssertOneRow(res.RowsAffected())
}
648141
func (db *DB) Delete(key []byte, wo *opt.WriteOptions) error {
	return db.putRec(keyTypeDel, key, nil, wo)
}
307398
func (s *Service) ForceRun(ctx context.Context, taskID influxdb.ID, scheduledFor int64) (*influxdb.Run, error) {
	var r *influxdb.Run
	err := s.kv.Update(ctx, func(tx Tx) error {
		run, err := s.forceRun(ctx, tx, taskID, scheduledFor)
		if err != nil {
			return err
		}
		r = run
		return nil
	})
	return r, err
}
1263094
func (tr Row) ForceTime(nn int, loc *time.Location) (val time.Time) {
	val, _ = tr.TimeErr(nn, loc)
	return
}
506551
func (sp *SendLocation) ForceReply(fr ForceReply) *SendLocation {
	var rmi ReplyMarkupInt = fr
	sp.ReplyMarkup = &rmi
	return sp
}
1085045
func (a *Agent) ForceLeave(node string) error {
	r := a.c.newRequest("PUT", "/v1/agent/force-leave/"+node)
	_, resp, err := requireOK(a.c.doRequest(r))
	if err != nil {
		return err
	}
	resp.Body.Close()
	return nil
}
465529
func (db *baseDB) Delete(model interface{}) error {
	return orm.Delete(db.db, model)
}
865591
func (db *DB) lDelete(t *batch, key []byte) int64 {
	mk := db.lEncodeMetaKey(key)

	var headSeq int32
	var tailSeq int32
	var err error

	it := db.bucket.NewIterator()
	defer it.Close()

	headSeq, tailSeq, _, err = db.lGetMeta(it, mk)
	if err != nil {
		return 0
	}

	var num int64
	startKey := db.lEncodeListKey(key, headSeq)
	stopKey := db.lEncodeListKey(key, tailSeq)

	rit := store.NewRangeIterator(it, &store.Range{
		Min:  startKey,
		Max:  stopKey,
		Type: store.RangeClose})
	for ; rit.Valid(); rit.Next() {
		t.Delete(rit.RawKey())
		num++
	}

	t.Delete(mk)

	return num
}
375532
func (l *lockServer) ForceUnlock(args *dsync.LockArgs, reply *bool) error {
	l.mutex.Lock()
	defer l.mutex.Unlock()
	if len(args.UID) != 0 {
		return fmt.Errorf("ForceUnlock called with non-empty UID: %s", args.UID)
	}
	if _, ok := l.lockMap[args.Resource]; ok { // Only clear lock when set
		delete(l.lockMap, args.Resource) // Remove the lock (irrespective of write or read lock)
	}
	*reply = true
	return nil
}
204391
func (r *Relation) DestroyOperation(force bool) *DestroyRelationOperation {
	return &DestroyRelationOperation{
		r:               &Relation{r.st, r.doc},
		ForcedOperation: ForcedOperation{Force: force},
	}
}
406288
func (c *modelStateCollection) Remove(query interface{}) error {
	return c.WriteCollection.Remove(c.mungeQuery(query))
}
957315
func (v *volumeClient) CredsDelete(uuid string) error {
	req := v.c.Delete().Resource(api.OsdCredsPath).Instance(uuid)
	response := req.Do()
	if response.Error() != nil {
		return response.FormatError()
	}
	return nil
}
1308958
func (t *Table) ForceIndex(index string) *Table {
	newTable := *t
	newTable.forcedIndex = index
	return &newTable
}
264913
func (m *Model) Remove() {
	for _, dir := range m.dirs {
		_ = os.RemoveAll(dir)
	}
}
1330011
func (w *WebHookPayload) GetForced() bool {
	if w == nil || w.Forced == nil {
		return false
	}
	return *w.Forced
}
340268
func (db *Database) buildDelete() string {
	var query bytes.Buffer
	query.WriteString(db.buildCTE())
	query.WriteString("DELETE FROM ")

	// Model only
	if len(db.tables) != 1 {
		db.panicLog("Unable to infer table name for Delete. Use Delete(model) or Model(model)")
	}
	query.WriteString(db.tables[0])

	// Where (mandatory)
	if len(db.whereFields) == 0 {
		db.panicLog("Where statement is mandatory in Delete")
	}

	query.WriteString(db.buildWhere())
	query.WriteString(";")

	qs := query.String()
	db.printLog(qs)
	return qs
}
264404
func (c *Client) Remove(storageIds []string, destroyAttachments, destroyStorage bool, force *bool, maxWait *time.Duration) ([]params.ErrorResult, error) {
	for _, id := range storageIds {
		if !names.IsValidStorage(id) {
			return nil, errors.NotValidf("storage ID %q", id)
		}
	}
	results := params.ErrorResults{}
	var args interface{}
	var method string
	if c.BestAPIVersion() <= 3 {
		if !destroyStorage {
			return nil, errors.Errorf("this juju controller does not support non-destructive removal of storage")
		}
		// In version 3, destroyAttached is ignored; removing
		// storage always causes detachment.
		entities := make([]params.Entity, len(storageIds))
		for i, id := range storageIds {
			entities[i].Tag = names.NewStorageTag(id).String()
		}
		args = params.Entities{entities}
		method = "Destroy"
	} else {
		aStorage := make([]params.RemoveStorageInstance, len(storageIds))
		for i, id := range storageIds {
			aStorage[i] = params.RemoveStorageInstance{
				Tag:                names.NewStorageTag(id).String(),
				DestroyAttachments: destroyAttachments,
				DestroyStorage:     destroyStorage,
			}
			if c.BestAPIVersion() > 5 {
				aStorage[i].Force = force
				aStorage[i].MaxWait = maxWait
			}
		}
		args = params.RemoveStorage{aStorage}
		method = "Remove"
	}
	if err := c.facade.FacadeCall(method, args, &results); err != nil {
		return nil, errors.Trace(err)
	}
	if len(results.Results) != len(storageIds) {
		return nil, errors.Errorf(
			"expected %d result(s), got %d",
			len(storageIds), len(results.Results),
		)
	}
	return results.Results, nil
}