MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / Desc

Function Desc

app/controlplane/pkg/data/ent/ent.go:133–142  ·  view source on GitHub ↗

Desc applies the given fields in DESC order.

(fields ...string)

Source from the content-addressed store, hash-verified

131
132// Desc applies the given fields in DESC order.
133func Desc(fields ...string) func(*sql.Selector) {
134 return func(s *sql.Selector) {
135 for _, f := range fields {
136 if err := checkColumn(s.TableName(), f); err != nil {
137 s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)})
138 }
139 s.OrderBy(sql.Desc(s.C(f)))
140 }
141 }
142}
143
144// AggregateFunc applies an aggregation step on the group-by traversal/selector.
145type AggregateFunc func(*sql.Selector) string

Callers 15

ListMethod · 0.92
ListMethod · 0.92
ListMethod · 0.92
latestVersionFunction · 0.92
ListMembersMethod · 0.92
ListMethod · 0.92
ListMembersMethod · 0.92
ListProjectsByGroupMethod · 0.92
ListMethod · 0.92
FindByOrgMethod · 0.92

Calls 2

checkColumnFunction · 0.85
AddErrorMethod · 0.80

Tested by

no test coverage detected