upstep bun version (#243)

This commit is contained in:
tobi 2021-09-23 11:13:28 +02:00 committed by GitHub
commit 142f37f1bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 146 additions and 57 deletions

View file

@ -431,9 +431,13 @@ func (q *InsertQuery) appendOn(fmter schema.Formatter, b []byte) (_ []byte, err
b = q.appendSetExcluded(b, fields)
}
b, err = q.appendWhere(fmter, b, true)
if err != nil {
return nil, err
if len(q.where) > 0 {
b = append(b, " WHERE "...)
b, err = appendWhere(fmter, b, q.where)
if err != nil {
return nil, err
}
}
return b, nil