mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 12:32:25 -05:00
[chore] update bun + extras v1.1.16 -> v1.1.17 (#2534)
This commit is contained in:
parent
a43ce99da9
commit
6433a50582
53 changed files with 1426 additions and 294 deletions
35
vendor/github.com/uptrace/bun/query_update.go
generated
vendored
35
vendor/github.com/uptrace/bun/query_update.go
generated
vendored
|
|
@ -20,6 +20,7 @@ type UpdateQuery struct {
|
|||
setQuery
|
||||
idxHintsQuery
|
||||
|
||||
joins []joinQuery
|
||||
omitZero bool
|
||||
}
|
||||
|
||||
|
|
@ -133,6 +134,33 @@ func (q *UpdateQuery) OmitZero() *UpdateQuery {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
func (q *UpdateQuery) Join(join string, args ...interface{}) *UpdateQuery {
|
||||
q.joins = append(q.joins, joinQuery{
|
||||
join: schema.SafeQuery(join, args),
|
||||
})
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *UpdateQuery) JoinOn(cond string, args ...interface{}) *UpdateQuery {
|
||||
return q.joinOn(cond, args, " AND ")
|
||||
}
|
||||
|
||||
func (q *UpdateQuery) JoinOnOr(cond string, args ...interface{}) *UpdateQuery {
|
||||
return q.joinOn(cond, args, " OR ")
|
||||
}
|
||||
|
||||
func (q *UpdateQuery) joinOn(cond string, args []interface{}, sep string) *UpdateQuery {
|
||||
if len(q.joins) == 0 {
|
||||
q.err = errors.New("bun: query has no joins")
|
||||
return q
|
||||
}
|
||||
j := &q.joins[len(q.joins)-1]
|
||||
j.on = append(j.on, schema.SafeQueryWithSep(cond, args, sep))
|
||||
return q
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
func (q *UpdateQuery) WherePK(cols ...string) *UpdateQuery {
|
||||
q.addWhereCols(cols)
|
||||
return q
|
||||
|
|
@ -230,6 +258,13 @@ func (q *UpdateQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, e
|
|||
}
|
||||
}
|
||||
|
||||
for _, j := range q.joins {
|
||||
b, err = j.AppendQuery(fmter, b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if q.hasFeature(feature.Output) && q.hasReturning() {
|
||||
b = append(b, " OUTPUT "...)
|
||||
b, err = q.appendOutput(fmter, b)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue