MCPcopy Index your code
hub / github.com/ent/ent / join

Method join

dialect/sql/builder.go:2111–2130  ·  view source on GitHub ↗

join adds a join table to the selector with the given kind.

(kind string, t TableView)

Source from the content-addressed store, hash-verified

2109
2110// join adds a join table to the selector with the given kind.
2111func (s *Selector) join(kind string, t TableView) *Selector {
2112 s.joins = append(s.joins, join{
2113 kind: kind,
2114 table: t,
2115 })
2116 switch view := t.(type) {
2117 case *SelectTable:
2118 if view.as == "" {
2119 view.as = "t" + strconv.Itoa(len(s.joins))
2120 }
2121 case *Selector:
2122 if view.as == "" {
2123 view.as = "t" + strconv.Itoa(len(s.joins))
2124 }
2125 }
2126 if st, ok := t.(state); ok {
2127 st.SetDialect(s.dialect)
2128 }
2129 return s
2130}
2131
2132type (
2133 // setOp represents a set/compound operation.

Callers 4

JoinMethod · 0.95
LeftJoinMethod · 0.95
RightJoinMethod · 0.95
FullJoinMethod · 0.95

Calls 1

SetDialectMethod · 0.65

Tested by

no test coverage detected