This commit is contained in:
demoManito 2023-10-20 20:54:41 +08:00
parent 685ece80d4
commit b2ff96b2e2
1 changed files with 3 additions and 8 deletions

View File

@ -19,20 +19,15 @@ func (set Set) Build(builder Builder) {
if len(set) > 0 {
for idx, assignment := range set {
if idx > 0 {
builder.WriteByte(',')
builder.WriteByte(' ')
builder.WriteString(", ")
}
builder.WriteQuoted(assignment.Column)
builder.WriteByte(' ')
builder.WriteByte('=')
builder.WriteByte(' ')
builder.WriteString(" = ")
builder.AddVar(builder, assignment.Value)
}
} else {
builder.WriteQuoted(Column{Name: PrimaryKey})
builder.WriteByte(' ')
builder.WriteByte('=')
builder.WriteByte(' ')
builder.WriteString(" = ")
builder.WriteQuoted(Column{Name: PrimaryKey})
}
}