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

Method NegationBuild

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

Source from the content-addressed store, hash-verified

209}
210
211func (in IN) NegationBuild(builder Builder) {
212 builder.WriteQuoted(in.Column)
213 switch len(in.Values) {
214 case 0:
215 builder.WriteString(" IS NOT NULL")
216 case 1:
217 if _, ok := in.Values[0].([]interface{}); !ok {
218 builder.WriteString(" <> ")
219 builder.AddVar(builder, in.Values[0])
220 break
221 }
222
223 fallthrough
224 default:
225 builder.WriteString(" NOT IN (")
226 builder.AddVar(builder, in.Values...)
227 builder.WriteByte(')')
228 }
229}
230
231// Eq equal to for where
232type Eq struct {

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