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

Method writeSetter

dialect/sql/builder.go:666–688  ·  view source on GitHub ↗

writeSetter writes the "SET" clause for the UPDATE statement.

(b *Builder)

Source from the content-addressed store, hash-verified

664
665// writeSetter writes the "SET" clause for the UPDATE statement.
666func (u *UpdateBuilder) writeSetter(b *Builder) {
667 for i, c := range u.nulls {
668 if i > 0 {
669 b.Comma()
670 }
671 b.Ident(c).WriteString(" = NULL")
672 }
673 if len(u.nulls) > 0 && len(u.columns) > 0 {
674 b.Comma()
675 }
676 for i, c := range u.columns {
677 if i > 0 {
678 b.Comma()
679 }
680 b.Ident(c).WriteString(" = ")
681 switch v := u.values[i].(type) {
682 case Querier:
683 b.Join(v)
684 default:
685 b.Arg(v)
686 }
687 }
688}
689
690// DeleteBuilder is a builder for `DELETE` statement.
691type DeleteBuilder struct {

Callers 2

QueryMethod · 0.95
writeConflictMethod · 0.80

Calls 5

CommaMethod · 0.80
WriteStringMethod · 0.80
IdentMethod · 0.80
ArgMethod · 0.80
JoinMethod · 0.45

Tested by

no test coverage detected