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

Function Asc

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

Asc applies the given fields in ASC order.

(fields ...string)

Source from the content-addressed store, hash-verified

119
120// Asc applies the given fields in ASC order.
121func Asc(fields ...string) func(*sql.Selector) {
122 return func(s *sql.Selector) {
123 for _, f := range fields {
124 if err := checkColumn(s.TableName(), f); err != nil {
125 s.AddError(&ValidationError{Name: f, err: fmt.Errorf("ent: %w", err)})
126 }
127 s.OrderBy(sql.Asc(s.C(f)))
128 }
129 }
130}
131
132// Desc applies the given fields in DESC order.
133func Desc(fields ...string) func(*sql.Selector) {

Callers 1

ListMethod · 0.92

Calls 2

checkColumnFunction · 0.85
AddErrorMethod · 0.80

Tested by

no test coverage detected