// selectFields generates comma separated field names string
6017
func selectFields(val interface{} /*, opts Options*/) (statement string) {
	fields := structs.ListExportedFields(val, cqlExported)
	ret := bytes.Buffer{}
	first := true
	for _, field := range fields {
		fieldName, exported := fieldName(field)
		if exported {
			if first {
				first = false
			} else {
				ret.WriteString(", ")
			}

			ret.WriteString(fieldName)
		}
	}

	return ret.String()
}
441944
func selectContainers(containers []v1.Container, spec string) ([]*v1.Container, []*v1.Container) {
	out := []*v1.Container{}
	skipped := []*v1.Container{}
	for i, c := range containers {
		if selectString(c.Name, spec) {
			out = append(out, &containers[i])
		} else {
			skipped = append(skipped, &containers[i])
		}
	}
	return out, skipped
}
300111
func (s *SelectQuery) SelectOption(option string) *SelectQuery {
	s.selectOption = option
	return s
}
731513
func selectQuery(query *protocol.KontrolQuery) (string, []interface{}, error) {
	psql := sq.StatementBuilder.PlaceholderFormat(sq.Dollar)

	kites := psql.Select("*").From("kite.kite")
	fields := query.Fields()
	andQuery := sq.And{}

	// we stop for the first empty value
	for _, key := range keyOrder {
		v := fields[key]
		if v == "" {
			continue
		}

		// we are using "kitename" as the columname
		if key == "name" {
			key = "kitename"
		}

		andQuery = append(andQuery, sq.Eq{key: v})
	}

	if len(andQuery) == 0 {
		return "", nil, ErrQueryFieldsEmpty
	}

	return kites.Where(andQuery).ToSql()
}
24127
func (db *DB) SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error {
	return SelectContext(ctx, db, dest, query, args...)
}
1281451
func (f *Form) SelectValues(name string) ([]string, error) {
	if _, ok := f.fields[name]; ok {
		return f.fields[name], nil
	}
	return nil, errors.NewElementNotFound("No input found with name '%s'.", name)
}
417546
func (r *SearchRequest) ScriptFields(fields ...*ScriptField) *SearchRequest {
	r.searchSource = r.searchSource.ScriptFields(fields...)
	return r
}
122028
func mapFields(fields []string) map[string]uint16 {
	rv := make(map[string]uint16, len(fields))
	for i, fieldName := range fields {
		rv[fieldName] = uint16(i) + 1
	}
	return rv
}
853149
func ToSelectableFields(obj *apiregistration.APIService) fields.Set {
	return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
}
940943
func SelectCertificate(s dbOneSelector, q string, args ...interface{}) (core.Certificate, error) {
	var model core.Certificate
	err := s.SelectOne(
		&model,
		"SELECT "+certFields+" FROM certificates "+q,
		args...,
	)
	return model, err
}
855535
func (s *NodesStatsService) Fields(fields ...string) *NodesStatsService {
	s.fields = append(s.fields, fields...)
	return s
}
764722
func (p *Provider) SetCustomFields(fields []string) *Provider {
	p.Fields = strings.Join(fields, ",")
	return p
}
1202947
func SelectableFields(obj *imageapi.ImageStreamTag) fields.Set {
	return generic.ObjectMetaFieldsSet(&obj.ObjectMeta, true)
}
157429
func (s *SearchSource) ScriptFields(scriptFields ...*ScriptField) *SearchSource {
	s.scriptFields = append(s.scriptFields, scriptFields...)
	return s
}
890227
func (ms modelSpec) fieldNames() []string {
	names := make([]string, len(ms.fields))
	count := 0
	for _, field := range ms.fields {
		names[count] = field.name
		count++
	}
	return names
}
271218
func CombineFields(s []Field) string {
	r := make([]string, len(s))
	for i, v := range s {
		r[i] = string(v)
	}
	return strings.Join(r, ",")
}
1285479
func (s *ScanOp) Fields(fields []string) *ScanOp {
	s.fieldsToRead = fields
	return s
}