Skip to content

Commit

Permalink
adjust the position of UPDATE JOIN
Browse files Browse the repository at this point in the history
  • Loading branch information
xgfone committed Jan 7, 2025
1 parent 3d31683 commit a124896
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions dml_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,17 +214,12 @@ func (b *UpdateBuilder) Build() (sql string, args *ArgsBuilder) {
}
}

// Join
for _, join := range b.jtables {
join.Build(buf, dialect)
}

// Set
buf.WriteString(" SET ")
args = GetArgsBuilderFromPool(dialect)
buf.WriteString(BuildOper(args, op.Batch(b.setters...)))

// From
// From Table
for i, t := range b.ftables {
if i == 0 {
buf.WriteString(" FROM ")
Expand All @@ -238,6 +233,11 @@ func (b *UpdateBuilder) Build() (sql string, args *ArgsBuilder) {
}
}

// Join
for _, join := range b.jtables {
join.Build(buf, dialect)
}

// Where
args = buildWheres(buf, args, dialect, b.wheres)

Expand Down

0 comments on commit a124896

Please sign in to comment.