MCPcopy
hub / github.com/ent/ent / selectTerms

Function selectTerms

dialect/sql/sqlgraph/graph.go:505–518  ·  view source on GitHub ↗

selectTerms appends the select terms to the joined query. Afterward, the term aliases are utilized to order the root query.

(q *sql.Selector, ts []sql.OrderTerm)

Source from the content-addressed store, hash-verified

503// selectTerms appends the select terms to the joined query.
504// Afterward, the term aliases are utilized to order the root query.
505func selectTerms(q *sql.Selector, ts []sql.OrderTerm) {
506 for _, t := range ts {
507 switch t := t.(type) {
508 case *sql.OrderFieldTerm:
509 if t.As != "" {
510 q.AppendSelectAs(q.C(t.Field), t.As)
511 } else {
512 q.AppendSelect(q.C(t.Field))
513 }
514 case *sql.OrderExprTerm:
515 q.AppendSelectExprAs(t.Expr(q), t.As)
516 }
517 }
518}
519
520// OrderByNeighborTerms appends ordering based on the number of neighbors.
521// For example, order users by their number of posts.

Callers 2

OrderByNeighborsCountFunction · 0.85
OrderByNeighborTermsFunction · 0.85

Calls 5

AppendSelectAsMethod · 0.80
AppendSelectMethod · 0.80
AppendSelectExprAsMethod · 0.80
ExprMethod · 0.80
CMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…