MCPcopy
hub / github.com/crowdsecurity/crowdsec / Desc

Function Desc

pkg/database/ent/ent.go:115–124  ·  view source on GitHub ↗

Desc applies the given fields in DESC order.

(fields ...string)

Source from the content-addressed store, hash-verified

113
114// Desc applies the given fields in DESC order.
115func Desc(fields ...string) func(*sql.Selector) {
116 return func(s *sql.Selector) {
117 for _, f := range fields {
118 if err := checkColumn(s.TableName(), f); err != nil {
119 s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)})
120 }
121 s.OrderBy(sql.Desc(s.C(f)))
122 }
123 }
124}
125
126// AggregateFunc applies an aggregation step on the group-by traversal/selector.
127type AggregateFunc func(*sql.Selector) string

Calls 1

checkColumnFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…