mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-06 11:53:15 -06:00
[chore]: Bump github.com/uptrace/bun from 1.2.1 to 1.2.5
Bumps [github.com/uptrace/bun](https://github.com/uptrace/bun) from 1.2.1 to 1.2.5. - [Release notes](https://github.com/uptrace/bun/releases) - [Changelog](https://github.com/uptrace/bun/blob/master/CHANGELOG.md) - [Commits](https://github.com/uptrace/bun/compare/v1.2.1...v1.2.5) --- updated-dependencies: - dependency-name: github.com/uptrace/bun dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
51cb6cae16
commit
2470c8d8a0
43 changed files with 3161 additions and 245 deletions
29
vendor/github.com/uptrace/bun/schema/append_value.go
generated
vendored
29
vendor/github.com/uptrace/bun/schema/append_value.go
generated
vendored
|
|
@ -7,9 +7,9 @@ import (
|
|||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/puzpuzpuz/xsync/v3"
|
||||
"github.com/uptrace/bun/dialect"
|
||||
"github.com/uptrace/bun/dialect/sqltype"
|
||||
"github.com/uptrace/bun/extra/bunjson"
|
||||
|
|
@ -51,7 +51,7 @@ var appenders = []AppenderFunc{
|
|||
reflect.UnsafePointer: nil,
|
||||
}
|
||||
|
||||
var appenderMap sync.Map
|
||||
var appenderCache = xsync.NewMapOf[reflect.Type, AppenderFunc]()
|
||||
|
||||
func FieldAppender(dialect Dialect, field *Field) AppenderFunc {
|
||||
if field.Tag.HasOption("msgpack") {
|
||||
|
|
@ -67,7 +67,7 @@ func FieldAppender(dialect Dialect, field *Field) AppenderFunc {
|
|||
}
|
||||
|
||||
if fieldType.Kind() != reflect.Ptr {
|
||||
if reflect.PtrTo(fieldType).Implements(driverValuerType) {
|
||||
if reflect.PointerTo(fieldType).Implements(driverValuerType) {
|
||||
return addrAppender(appendDriverValue)
|
||||
}
|
||||
}
|
||||
|
|
@ -79,14 +79,14 @@ func FieldAppender(dialect Dialect, field *Field) AppenderFunc {
|
|||
}
|
||||
|
||||
func Appender(dialect Dialect, typ reflect.Type) AppenderFunc {
|
||||
if v, ok := appenderMap.Load(typ); ok {
|
||||
return v.(AppenderFunc)
|
||||
if v, ok := appenderCache.Load(typ); ok {
|
||||
return v
|
||||
}
|
||||
|
||||
fn := appender(dialect, typ)
|
||||
|
||||
if v, ok := appenderMap.LoadOrStore(typ, fn); ok {
|
||||
return v.(AppenderFunc)
|
||||
if v, ok := appenderCache.LoadOrStore(typ, fn); ok {
|
||||
return v
|
||||
}
|
||||
return fn
|
||||
}
|
||||
|
|
@ -99,10 +99,10 @@ func appender(dialect Dialect, typ reflect.Type) AppenderFunc {
|
|||
return appendTimeValue
|
||||
case timePtrType:
|
||||
return PtrAppender(appendTimeValue)
|
||||
case ipType:
|
||||
return appendIPValue
|
||||
case ipNetType:
|
||||
return appendIPNetValue
|
||||
case ipType, netipPrefixType, netipAddrType:
|
||||
return appendStringer
|
||||
case jsonRawMessageType:
|
||||
return appendJSONRawMessageValue
|
||||
}
|
||||
|
|
@ -123,7 +123,7 @@ func appender(dialect Dialect, typ reflect.Type) AppenderFunc {
|
|||
}
|
||||
|
||||
if kind != reflect.Ptr {
|
||||
ptr := reflect.PtrTo(typ)
|
||||
ptr := reflect.PointerTo(typ)
|
||||
if ptr.Implements(queryAppenderType) {
|
||||
return addrAppender(appendQueryAppenderValue)
|
||||
}
|
||||
|
|
@ -247,16 +247,15 @@ func appendTimeValue(fmter Formatter, b []byte, v reflect.Value) []byte {
|
|||
return fmter.Dialect().AppendTime(b, tm)
|
||||
}
|
||||
|
||||
func appendIPValue(fmter Formatter, b []byte, v reflect.Value) []byte {
|
||||
ip := v.Interface().(net.IP)
|
||||
return fmter.Dialect().AppendString(b, ip.String())
|
||||
}
|
||||
|
||||
func appendIPNetValue(fmter Formatter, b []byte, v reflect.Value) []byte {
|
||||
ipnet := v.Interface().(net.IPNet)
|
||||
return fmter.Dialect().AppendString(b, ipnet.String())
|
||||
}
|
||||
|
||||
func appendStringer(fmter Formatter, b []byte, v reflect.Value) []byte {
|
||||
return fmter.Dialect().AppendString(b, v.Interface().(fmt.Stringer).String())
|
||||
}
|
||||
|
||||
func appendJSONRawMessageValue(fmter Formatter, b []byte, v reflect.Value) []byte {
|
||||
bytes := v.Bytes()
|
||||
if bytes == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue