MCPcopy
hub / github.com/ent/ent / WriteOp

Method WriteOp

dialect/sql/builder.go:3132–3142  ·  view source on GitHub ↗

WriteOp writes an operator to the builder.

(op Op)

Source from the content-addressed store, hash-verified

3130
3131// WriteOp writes an operator to the builder.
3132func (b *Builder) WriteOp(op Op) *Builder {
3133 switch {
3134 case op >= OpEQ && op <= OpLike || op >= OpAdd && op <= OpMod:
3135 b.Pad().WriteString(ops[op]).Pad()
3136 case op == OpIsNull || op == OpNotNull:
3137 b.Pad().WriteString(ops[op])
3138 default:
3139 panic(fmt.Sprintf("invalid op %d", op))
3140 }
3141 return b
3142}
3143
3144type (
3145 // StmtInfo holds an information regarding

Callers 15

SelectFunction · 0.80
TestBuilderFunction · 0.80
TestSelector_OrderByExprFunction · 0.80
TestSelector_SelectExprFunction · 0.80
ColumnsOpMethod · 0.80
EQMethod · 0.80
NEQMethod · 0.80
LTMethod · 0.80
LTEMethod · 0.80
GTMethod · 0.80
GTEMethod · 0.80

Calls 2

PadMethod · 0.95
WriteStringMethod · 0.80

Tested by 5

SelectFunction · 0.64
TestBuilderFunction · 0.64
TestSelector_OrderByExprFunction · 0.64
TestSelector_SelectExprFunction · 0.64