// SetUnique adds "unique" to the create index statements for this
// index, if b is true.
194188
func (idx *IndexMap) SetUnique(b bool) *IndexMap {
	idx.Unique = b
	return idx
}
312967
func IsUniqueViolation(err error, indexName string) bool {
	if err == nil {
		return false
	}
	pqError, ok := err.(*pq.Error)
	if !ok {
		return false
	}
	return pqError.Code == errUniqueViolation && pqError.Constraint == indexName
}
220558
func (s *HlsEncryption) SetRepeatExtXKey(v bool) *HlsEncryption {
	s.RepeatExtXKey = &v
	return s
}
342388
func (s *NumberFilter) SetEq(v float64) *NumberFilter {
	s.Eq = &v
	return s
}
420679
func NewUniqueQueue(queueLength int) *UniqueQueue {
	if queueLength <= 0 {
		queueLength = 100
	}

	return &UniqueQueue{
		table: NewStatusTable(),
		queue: make(chan string, queueLength),
	}
}
300951
func (it *Unique) Reset() {
	it.result = nil
	it.subIt.Reset()
	it.seen = make(map[interface{}]bool)
}
435047
func (o *Strategy) SetCreateNew(v *CreateNew) *Strategy {
	if o.CreateNew = v; o.CreateNew == nil {
		o.nullFields = append(o.nullFields, "CreateNew")
	}
	return o
}
686221
func (bA *CompactBitArray) SetIndex(i int, v bool) bool {
	if bA == nil {
		return false
	}
	if i >= bA.Size() {
		return false
	}
	if v {
		bA.Elems[i>>3] |= (uint8(1) << uint8(7-(i%8)))
	} else {
		bA.Elems[i>>3] &= ^(uint8(1) << uint8(7-(i%8)))
	}
	return true
}
1183527
func (s *DB) AddUniqueIndex(indexName string, columns ...string) *DB {
	scope := s.Unscoped().NewScope(s.Value)
	scope.addIndex(true, indexName, columns...)
	return scope.db
}
151955
func (ipt *IPTables) AppendUnique(table string, args ...string) error {
	exists, err := ipt.Exists(table, args...)
	if err != nil {
		return err
	}

	if !exists {
		return ipt.Append(table, args...)
	}

	return nil
}
1188410
func (s *CPUUtilization) SetIRQ(v float64) *CPUUtilization {
	s.IRQ = &v
	return s
}
64161
func (cf *Filter) InsertUnique(data []byte) bool {
	if cf.Lookup(data) {
		return false
	}
	return cf.Insert(data)
}
423884
func (ipt *IPTables) AppendUnique(table, chain string, rulespec ...string) error {
	exists, err := ipt.Exists(table, chain, rulespec...)
	if err != nil {
		return err
	}

	if !exists {
		return ipt.Append(table, chain, rulespec...)
	}

	return nil
}
235778
func (s *RemoveAttributesActivity) SetNext(v string) *RemoveAttributesActivity {
	s.Next = &v
	return s
}
580642
func (a *SynthesizeScrollGestureArgs) SetRepeatCount(repeatCount int) *SynthesizeScrollGestureArgs {
	a.RepeatCount = &repeatCount
	return a
}
933665
func (s *ListAttachedPoliciesInput) SetRecursive(v bool) *ListAttachedPoliciesInput {
	s.Recursive = &v
	return s
}
83750
func (a *SearchInResponseBodyArgs) SetIsRegex(isRegex bool) *SearchInResponseBodyArgs {
	a.IsRegex = &isRegex
	return a
}