// Delete deletes the query with the given id, returns NotFoundError or InternalError
487586
func (r *GormQueryRepository) Delete(ctx context.Context, ID uuid.UUID) error {
	defer goa.MeasureSince([]string{"goa", "db", "query", "delete"}, time.Now())
	q := Query{ID: ID}
	tx := r.db.Delete(q)

	if err := tx.Error; err != nil {
		log.Error(ctx, map[string]interface{}{
			"query_id": ID.String(),
		}, "unable to delete the query")
		return errors.NewInternalError(ctx, err)
	}
	if tx.RowsAffected == 0 {
		log.Error(ctx, map[string]interface{}{
			"query_id": ID.String(),
		}, "no row was affected by the delete operation")
		return errors.NewNotFoundError("query", ID.String())
	}
	return nil
}
827938
func (*Config) Delete(c context.Context, req *config.DeleteRequest) (*empty.Empty, error) {
	if req.GetId() == "" {
		return nil, status.Errorf(codes.InvalidArgument, "ID is required")
	}
	if err := datastore.Delete(c, &model.Config{ID: req.Id}); err != nil {
		return nil, errors.Annotate(err, "failed to delete config").Err()
	}
	return &empty.Empty{}, nil
}
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)
}
1244502
func (idx *TruncIndex) Delete(id string) error {
	idx.Lock()
	defer idx.Unlock()
	if _, exists := idx.ids[id]; !exists || id == "" {
		return fmt.Errorf("no such id: '%s'", id)
	}
	delete(idx.ids, id)
	if deleted := idx.trie.Delete(patricia.Prefix(id)); !deleted {
		return fmt.Errorf("no such id: '%s'", id)
	}
	return nil
}
953503
func (s *UserStorage) Delete(id string) error {
	_, exists := s.users[id]
	if !exists {
		return fmt.Errorf("User with id %s does not exist", id)
	}
	delete(s.users, id)

	return nil
}
981891
func (m *GormIdentityRepository) Delete(ctx context.Context, id uuid.UUID, funcs ...func(*gorm.DB) *gorm.DB) error {
	defer goa.MeasureSince([]string{"goa", "db", "identity", "delete"}, time.Now())

	obj := Identity{ID: id}
	result := m.db.Scopes(funcs...).Delete(obj)

	if result.Error != nil {
		log.Error(ctx, map[string]interface{}{
			"identity_id": id,
			"err":         result.Error,
		}, "unable to delete the identity")
		return errs.WithStack(result.Error)
	}
	if result.RowsAffected == 0 {
		return errors.NewNotFoundError("identity", id.String())
	}

	log.Debug(ctx, map[string]interface{}{
		"identity_id": id,
	}, "Identity deleted!")

	return nil
}
772819
func (r *Record) Delete(args ...string) (err error) {
	switch len(args) {
	case 0:
		_, err = r.Client.Delete(r.uri("/records"), nil)
	case 1:
		_, err = r.Client.Delete(r.uri("/records/%s", args...), nil)
	case 2:
		_, err = r.Client.Delete(r.uri("/records/%s/%s", args...), nil)
	default:
		err = r.formatCallError("Delete", args...)
	}
	return
}
181123
func (db *Database) Delete() error {
	result := &struct {
		Error string `json:"error"`
		Ok    bool   `json:"ok"`
	}{}

	body, err := db.Req.Delete("")
	if err != nil {
		return err
	}

	err = json.Unmarshal(body, result)
	if err != nil {
		return err
	}

	if result.Error != "" {
		return errors.New(result.Error)
	}
	if !result.Ok {
		return errors.New("Couch returned failure when creating [" + db.Name + "]")
	}

	return nil
}
1005187
func (s *Server) Delete(ctx context.Context, q *SessionDeleteRequest) (*SessionResponse, error) {
	return &SessionResponse{Token: ""}, nil
}
881523
func (part *Partition) Delete(id int) (err error) {
	physID := part.lookup.Get(id, 1)
	if len(physID) == 0 {
		return dberr.New(dberr.ErrorNoDoc, id)
	}
	part.col.Delete(physID[0])
	part.lookup.Remove(id, physID[0])
	return
}
808861
func (col *Col) Delete(id int) error {
	col.db.schemaLock.RLock()
	part := col.parts[id%col.db.numParts]

	// Place lock, read back original document and delete document
	part.DataLock.Lock()
	originalB, err := part.Read(id)
	if err != nil {
		part.DataLock.Unlock()
		col.db.schemaLock.RUnlock()
		return err
	}
	err = part.Delete(id)
	part.DataLock.Unlock()
	if err != nil {
		col.db.schemaLock.RUnlock()
		return err
	}

	// Done with the collection data, next is to remove indexed values
	var original map[string]interface{}
	err = json.Unmarshal(originalB, &original)
	if err == nil {
		part.LockUpdate(id)
		col.unindexDoc(id, original)
		part.UnlockUpdate(id)
	} else {
		tdlog.Noticef("Will not attempt to unindex document %d during delete", id)
	}

	col.db.schemaLock.RUnlock()
	return nil
}
303634
func (repo *repo) Delete(user service.Entity) error {
	return dbconn.DB.Delete(&user).Error
}
581982
func (r *Redis) Delete(key string) error {
	return r.Client.Del(key).Err()
}
1276529
func (p *PoliciesClient) Delete(ctx context.Context, policyID *identity.ID) error {
	url := "/policies/" + policyID.String()
	return p.client.RoundTrip(ctx, "DELETE", url, nil, nil, nil)
}
813824
func (_m *ClusterServiceServer) Delete(_a0 context.Context, _a1 *cluster.ClusterQuery) (*cluster.ClusterResponse, error) {
	ret := _m.Called(_a0, _a1)

	var r0 *cluster.ClusterResponse
	if rf, ok := ret.Get(0).(func(context.Context, *cluster.ClusterQuery) *cluster.ClusterResponse); ok {
		r0 = rf(_a0, _a1)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*cluster.ClusterResponse)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(context.Context, *cluster.ClusterQuery) error); ok {
		r1 = rf(_a0, _a1)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1061682
func (r *RoomService) Delete(id string) (*http.Response, error) {
	req, err := r.client.NewRequest("DELETE", fmt.Sprintf("room/%s", id), nil, nil)
	if err != nil {
		return nil, err
	}

	return r.client.Do(req, nil)
}
1266669
func (m *Map) Delete(k ident.ID) {
	hash := m.hash(k)
	for entry, ok := m.lookup[hash]; ok; entry, ok = m.lookup[hash] {
		if m.equals(entry.key.key, k) {
			m.removeMapKey(hash, entry.key)
			return
		}
		// Linear probe to "next" to this entry (really a rehash)
		hash++
	}
}