mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-14 21:53:00 -06:00
bumps uptrace/bun dependencies to v1.2.6 (#3569)
This commit is contained in:
parent
a444adee97
commit
3fceb5fc1a
68 changed files with 6517 additions and 194 deletions
49
vendor/github.com/uptrace/bun/query_update.go
generated
vendored
49
vendor/github.com/uptrace/bun/query_update.go
generated
vendored
|
|
@ -15,6 +15,7 @@ import (
|
|||
|
||||
type UpdateQuery struct {
|
||||
whereBaseQuery
|
||||
orderLimitOffsetQuery
|
||||
returningQuery
|
||||
customValueQuery
|
||||
setQuery
|
||||
|
|
@ -53,10 +54,12 @@ func (q *UpdateQuery) Err(err error) *UpdateQuery {
|
|||
return q
|
||||
}
|
||||
|
||||
// Apply calls the fn passing the SelectQuery as an argument.
|
||||
func (q *UpdateQuery) Apply(fn func(*UpdateQuery) *UpdateQuery) *UpdateQuery {
|
||||
if fn != nil {
|
||||
return fn(q)
|
||||
// Apply calls each function in fns, passing the UpdateQuery as an argument.
|
||||
func (q *UpdateQuery) Apply(fns ...func(*UpdateQuery) *UpdateQuery) *UpdateQuery {
|
||||
for _, fn := range fns {
|
||||
if fn != nil {
|
||||
q = fn(q)
|
||||
}
|
||||
}
|
||||
return q
|
||||
}
|
||||
|
|
@ -200,6 +203,34 @@ func (q *UpdateQuery) WhereAllWithDeleted() *UpdateQuery {
|
|||
return q
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
func (q *UpdateQuery) Order(orders ...string) *UpdateQuery {
|
||||
if !q.hasFeature(feature.UpdateOrderLimit) {
|
||||
q.err = errors.New("bun: order is not supported for current dialect")
|
||||
return q
|
||||
}
|
||||
q.addOrder(orders...)
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *UpdateQuery) OrderExpr(query string, args ...interface{}) *UpdateQuery {
|
||||
if !q.hasFeature(feature.UpdateOrderLimit) {
|
||||
q.err = errors.New("bun: order is not supported for current dialect")
|
||||
return q
|
||||
}
|
||||
q.addOrderExpr(query, args...)
|
||||
return q
|
||||
}
|
||||
|
||||
func (q *UpdateQuery) Limit(n int) *UpdateQuery {
|
||||
if !q.hasFeature(feature.UpdateOrderLimit) {
|
||||
q.err = errors.New("bun: limit is not supported for current dialect")
|
||||
return q
|
||||
}
|
||||
q.setLimit(n)
|
||||
return q
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// Returning adds a RETURNING clause to the query.
|
||||
|
|
@ -278,6 +309,16 @@ func (q *UpdateQuery) AppendQuery(fmter schema.Formatter, b []byte) (_ []byte, e
|
|||
return nil, err
|
||||
}
|
||||
|
||||
b, err = q.appendOrder(fmter, b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
b, err = q.appendLimitOffset(fmter, b)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if q.hasFeature(feature.Returning) && q.hasReturning() {
|
||||
b = append(b, " RETURNING "...)
|
||||
b, err = q.appendReturning(fmter, b)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue