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

Function Asc

pkg/database/ent/ent.go:103–112  ·  view source on GitHub ↗

Asc applies the given fields in ASC order.

(fields ...string)

Source from the content-addressed store, hash-verified

101
102// Asc applies the given fields in ASC order.
103func Asc(fields ...string) func(*sql.Selector) {
104 return func(s *sql.Selector) {
105 for _, f := range fields {
106 if err := checkColumn(s.TableName(), f); err != nil {
107 s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)})
108 }
109 s.OrderBy(sql.Asc(s.C(f)))
110 }
111 }
112}
113
114// Desc applies the given fields in DESC order.
115func Desc(fields ...string) func(*sql.Selector) {

Calls 1

checkColumnFunction · 0.85

Tested by

no test coverage detected