MCPcopy
hub / github.com/ent/ent / OrderBy

Method OrderBy

dialect/sql/builder.go:2440–2445  ·  view source on GitHub ↗

OrderBy appends the `ORDER BY` clause to the `SELECT` statement.

(columns ...string)

Source from the content-addressed store, hash-verified

2438
2439// OrderBy appends the `ORDER BY` clause to the `SELECT` statement.
2440func (s *Selector) OrderBy(columns ...string) *Selector {
2441 for i := range columns {
2442 s.order = append(s.order, columns[i])
2443 }
2444 return s
2445}
2446
2447// OrderColumns returns the ordered columns in the Selector.
2448// Note, this function skips columns selected with expressions.

Callers 15

RunMethod · 0.45
SelectFunction · 0.45
limitRowsFunction · 0.45
AscFunction · 0.45
DescFunction · 0.45
AscFunction · 0.45
DescFunction · 0.45
AscFunction · 0.45
DescFunction · 0.45
AscFunction · 0.45
DescFunction · 0.45
AscFunction · 0.45

Calls

no outgoing calls

Tested by 14

SelectFunction · 0.36
limitRowsFunction · 0.36
TestBuilderFunction · 0.36
TestSelector_OrderByExprFunction · 0.36
TestSelector_ClearOrderFunction · 0.36
TestWindowFunctionFunction · 0.36
TestMultipleFromFunction · 0.36
TestUpdateNodesFunction · 0.36