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

Method join

dialect/sql/builder.go:3244–3265  ·  view source on GitHub ↗

join a list of Queries to the builder with a given separator.

(qs []Querier, sep string)

Source from the content-addressed store, hash-verified

3242
3243// join a list of Queries to the builder with a given separator.
3244func (b *Builder) join(qs []Querier, sep string) *Builder {
3245 for i, q := range qs {
3246 if i > 0 {
3247 b.WriteString(sep)
3248 }
3249 st, ok := q.(state)
3250 if ok {
3251 st.SetDialect(b.dialect)
3252 st.SetTotal(b.total)
3253 }
3254 query, args := q.Query()
3255 b.WriteString(query)
3256 b.args = append(b.args, args...)
3257 b.total += len(args)
3258 if qe, ok := q.(querierErr); ok {
3259 if err := qe.Err(); err != nil {
3260 b.AddError(err)
3261 }
3262 }
3263 }
3264 return b
3265}
3266
3267// Wrap gets a callback, and wraps its result with parentheses.
3268func (b *Builder) Wrap(f func(*Builder)) *Builder {

Callers 4

JoinMethod · 0.95
JoinCommaMethod · 0.95
QueryMethod · 0.45
joinPrefixMethod · 0.45

Calls 6

WriteStringMethod · 0.95
AddErrorMethod · 0.95
SetDialectMethod · 0.65
SetTotalMethod · 0.65
QueryMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected