MCPcopy
hub / github.com/go-gorm/gorm / Build

Method Build

clause/expression.go:190–209  ·  view source on GitHub ↗
(builder Builder)

Source from the content-addressed store, hash-verified

188}
189
190func (in IN) Build(builder Builder) {
191 builder.WriteQuoted(in.Column)
192
193 switch len(in.Values) {
194 case 0:
195 builder.WriteString(" IN (NULL)")
196 case 1:
197 if _, ok := in.Values[0].([]interface{}); !ok {
198 builder.WriteString(" = ")
199 builder.AddVar(builder, in.Values[0])
200 break
201 }
202
203 fallthrough
204 default:
205 builder.WriteString(" IN (")
206 builder.AddVar(builder, in.Values...)
207 builder.WriteByte(')')
208 }
209}
210
211func (in IN) NegationBuild(builder Builder) {
212 builder.WriteQuoted(in.Column)

Callers

nothing calls this directly

Calls 4

WriteQuotedMethod · 0.65
WriteStringMethod · 0.65
AddVarMethod · 0.65
WriteByteMethod · 0.65

Tested by

no test coverage detected