MCPcopy
hub / github.com/ent/ent / Wrap

Method Wrap

dialect/sql/builder.go:3268–3277  ·  view source on GitHub ↗

Wrap gets a callback, and wraps its result with parentheses.

(f func(*Builder))

Source from the content-addressed store, hash-verified

3266
3267// Wrap gets a callback, and wraps its result with parentheses.
3268func (b *Builder) Wrap(f func(*Builder)) *Builder {
3269 nb := &Builder{dialect: b.dialect, total: b.total, sb: &strings.Builder{}}
3270 nb.WriteByte('(')
3271 f(nb)
3272 nb.WriteByte(')')
3273 b.WriteString(nb.String())
3274 b.args = append(b.args, nb.args...)
3275 b.total = nb.total
3276 return b
3277}
3278
3279// Nested gets a callback, and wraps its result with parentheses.
3280//

Callers 15

NestedMethod · 0.95
TestSelector_SelectExprFunction · 0.80
QueryMethod · 0.80
AddMethod · 0.80
NotFunction · 0.80
InMethod · 0.80
NotInMethod · 0.80
ExistsMethod · 0.80
NotExistsMethod · 0.80
compositePMethod · 0.80
argMethod · 0.80

Calls 3

WriteByteMethod · 0.95
WriteStringMethod · 0.95
StringMethod · 0.95

Tested by 2

TestSelector_SelectExprFunction · 0.64