diff --git a/go.mod b/go.mod index db2a4c3b1..f6ffd081e 100644 --- a/go.mod +++ b/go.mod @@ -48,10 +48,10 @@ require ( github.com/tdewolff/minify/v2 v2.12.9 github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 github.com/ulule/limiter/v3 v3.11.2 - github.com/uptrace/bun v1.1.15 - github.com/uptrace/bun/dialect/pgdialect v1.1.15 - github.com/uptrace/bun/dialect/sqlitedialect v1.1.15 - github.com/uptrace/bun/extra/bunotel v1.1.15 + github.com/uptrace/bun v1.1.16 + github.com/uptrace/bun/dialect/pgdialect v1.1.16 + github.com/uptrace/bun/dialect/sqlitedialect v1.1.16 + github.com/uptrace/bun/extra/bunotel v1.1.16 github.com/wagslane/go-password-validator v0.3.0 github.com/yuin/goldmark v1.5.6 go.opentelemetry.io/otel v1.17.0 diff --git a/go.sum b/go.sum index de9eff1ee..1740ffdbb 100644 --- a/go.sum +++ b/go.sum @@ -578,14 +578,14 @@ github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4d github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulule/limiter/v3 v3.11.2 h1:P4yOrxoEMJbOTfRJR2OzjL90oflzYPPmWg+dvwN2tHA= github.com/ulule/limiter/v3 v3.11.2/go.mod h1:QG5GnFOCV+k7lrL5Y8kgEeeflPH3+Cviqlqa8SVSQxI= -github.com/uptrace/bun v1.1.15 h1:uxLNIo1VN8pkJ8rykwPBd9qYg4NDTvjHIintnwoQ3QY= -github.com/uptrace/bun v1.1.15/go.mod h1:7HnsMRRvpLFUcquJxp22JO8PsWKpFQO/gNXqqsuGWg8= -github.com/uptrace/bun/dialect/pgdialect v1.1.15 h1:fLmWvUPNqOhnZxJ4IqypXOQGxmXQJr1ISaIscRddPPY= -github.com/uptrace/bun/dialect/pgdialect v1.1.15/go.mod h1:777qGnrISxHQ+Ulj5YbmmwywfQLLmIYJIoCbGZ+M7lY= -github.com/uptrace/bun/dialect/sqlitedialect v1.1.15 h1:uZqBNm4iJnDO4mZ1UXUzGqMhjxB5SAsafMF58s2gmkQ= -github.com/uptrace/bun/dialect/sqlitedialect v1.1.15/go.mod h1:ymLR6ladQrWS7eYTX45+lTIK7vocXiE3jXNBxUZMJlU= -github.com/uptrace/bun/extra/bunotel v1.1.15 h1:ulzA0UqqMmTXsu7M0F23VGIdY1gFyLxgZhlAZwPMHXE= -github.com/uptrace/bun/extra/bunotel v1.1.15/go.mod h1:nOsIf8xAROpI5ZbiO9Ys/fE2wJB23wMBBrH8XsVhEJk= +github.com/uptrace/bun v1.1.16 h1:cn9cgEMFwcyYRsQLfxCRMUxyK1WaHwOVrR3TvzEFZ/A= +github.com/uptrace/bun v1.1.16/go.mod h1:7HnsMRRvpLFUcquJxp22JO8PsWKpFQO/gNXqqsuGWg8= +github.com/uptrace/bun/dialect/pgdialect v1.1.16 h1:eUPZ+YCJ69BA+W1X1ZmpOJSkv1oYtinr0zCXf7zCo5g= +github.com/uptrace/bun/dialect/pgdialect v1.1.16/go.mod h1:KQjfx/r6JM0OXfbv0rFrxAbdkPD7idK8VitnjIV9fZI= +github.com/uptrace/bun/dialect/sqlitedialect v1.1.16 h1:gbc9BP/e4sNOB9VBj+Si46dpOz2oktmZPidkda92GYY= +github.com/uptrace/bun/dialect/sqlitedialect v1.1.16/go.mod h1:YNezpK7fIn5Wa2WGmTCZ/nEyiswcXmuT4iNWADeL1x4= +github.com/uptrace/bun/extra/bunotel v1.1.16 h1:qkLTaTZK3FZk3b2P/stO/krS7KX9Fq5wSOj7Hlb2HG8= +github.com/uptrace/bun/extra/bunotel v1.1.16/go.mod h1:JwEH0kdXFnzYuK8D6eXUrf9HKsYy5wmB+lqQ/+dvH4E= github.com/uptrace/opentelemetry-go-extra/otelsql v0.2.2 h1:USRngIQppxeyb39XzkVHXwQesKK0+JSwnHE/1c7fgic= github.com/uptrace/opentelemetry-go-extra/otelsql v0.2.2/go.mod h1:1frv9RN1rlTq0jzCq+mVuEQisubZCQ4OU6S/8CaHzGY= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= diff --git a/vendor/github.com/uptrace/bun/CHANGELOG.md b/vendor/github.com/uptrace/bun/CHANGELOG.md index f1d9577c3..8a95c45dc 100644 --- a/vendor/github.com/uptrace/bun/CHANGELOG.md +++ b/vendor/github.com/uptrace/bun/CHANGELOG.md @@ -1,3 +1,12 @@ +## [1.1.16](https://github.com/uptrace/bun/compare/v1.1.15...v1.1.16) (2023-09-16) + + +### Reverts + +* Revert "fix: "model does not have column" error (#850)" ([387228e](https://github.com/uptrace/bun/commit/387228e85d22dfcf3659f4631dfa87106d7ef45f)), closes [#850](https://github.com/uptrace/bun/issues/850) + + + ## [1.1.15](https://github.com/uptrace/bun/compare/v1.1.14...v1.1.15) (2023-09-10) diff --git a/vendor/github.com/uptrace/bun/dialect/pgdialect/version.go b/vendor/github.com/uptrace/bun/dialect/pgdialect/version.go index bea5c4d2d..9b3f8e228 100644 --- a/vendor/github.com/uptrace/bun/dialect/pgdialect/version.go +++ b/vendor/github.com/uptrace/bun/dialect/pgdialect/version.go @@ -2,5 +2,5 @@ // Version is the current release version. func Version() string { - return "1.1.15" + return "1.1.16" } diff --git a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go b/vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go index 4fbb58cee..8baf8191f 100644 --- a/vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go +++ b/vendor/github.com/uptrace/bun/dialect/sqlitedialect/version.go @@ -2,5 +2,5 @@ // Version is the current release version. func Version() string { - return "1.1.15" + return "1.1.16" } diff --git a/vendor/github.com/uptrace/bun/package.json b/vendor/github.com/uptrace/bun/package.json index b4c8d6ca6..ad384286b 100644 --- a/vendor/github.com/uptrace/bun/package.json +++ b/vendor/github.com/uptrace/bun/package.json @@ -1,6 +1,6 @@ { "name": "gobun", - "version": "1.1.15", + "version": "1.1.16", "main": "index.js", "repository": "git@github.com:uptrace/bun.git", "author": "Vladimir Mihailenco ", diff --git a/vendor/github.com/uptrace/bun/schema/table.go b/vendor/github.com/uptrace/bun/schema/table.go index cd0ff20b2..9eb7d1bfe 100644 --- a/vendor/github.com/uptrace/bun/schema/table.go +++ b/vendor/github.com/uptrace/bun/schema/table.go @@ -4,7 +4,6 @@ "database/sql" "fmt" "reflect" - "strconv" "strings" "sync" "time" @@ -807,38 +806,18 @@ func (t *Table) m2mRelation(field *Field) *Relation { return rel } -type seenKey struct { - Table reflect.Type - FieldIndex string -} - -type seenMap map[seenKey]struct{} - -func NewSeenKey(table reflect.Type, fieldIndex []int) (key seenKey) { - key.Table = table - for _, index := range fieldIndex { - key.FieldIndex += strconv.Itoa(index) + "-" - } - return key -} - -func (s seenMap) Clone() seenMap { - t := make(seenMap) - for k, v := range s { - t[k] = v - } - return t -} - -func (t *Table) inlineFields(field *Field, seen seenMap) { +func (t *Table) inlineFields(field *Field, seen map[reflect.Type]struct{}) { if seen == nil { - seen = make(seenMap) + seen = map[reflect.Type]struct{}{t.Type: {}} } + if _, ok := seen[field.IndirectType]; ok { + return + } + seen[field.IndirectType] = struct{}{} + joinTable := t.dialect.Tables().Ref(field.IndirectType) for _, f := range joinTable.allFields { - key := NewSeenKey(joinTable.Type, f.Index) - f = f.Clone() f.GoName = field.GoName + "_" + f.GoName f.Name = field.Name + "__" + f.Name @@ -855,9 +834,7 @@ func (t *Table) inlineFields(field *Field, seen seenMap) { continue } - if _, ok := seen[key]; !ok { - seen = seen.Clone() - seen[key] = struct{}{} + if _, ok := seen[f.IndirectType]; !ok { t.inlineFields(f, seen) } } diff --git a/vendor/github.com/uptrace/bun/version.go b/vendor/github.com/uptrace/bun/version.go index 371014de7..641a29074 100644 --- a/vendor/github.com/uptrace/bun/version.go +++ b/vendor/github.com/uptrace/bun/version.go @@ -2,5 +2,5 @@ // Version is the current release version. func Version() string { - return "1.1.15" + return "1.1.16" } diff --git a/vendor/modules.txt b/vendor/modules.txt index 99c7b384f..3b4f81548 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -702,7 +702,7 @@ github.com/ugorji/go/codec github.com/ulule/limiter/v3 github.com/ulule/limiter/v3/drivers/store/common github.com/ulule/limiter/v3/drivers/store/memory -# github.com/uptrace/bun v1.1.15 +# github.com/uptrace/bun v1.1.16 ## explicit; go 1.19 github.com/uptrace/bun github.com/uptrace/bun/dialect @@ -714,13 +714,13 @@ github.com/uptrace/bun/internal/parser github.com/uptrace/bun/internal/tagparser github.com/uptrace/bun/migrate github.com/uptrace/bun/schema -# github.com/uptrace/bun/dialect/pgdialect v1.1.15 +# github.com/uptrace/bun/dialect/pgdialect v1.1.16 ## explicit; go 1.19 github.com/uptrace/bun/dialect/pgdialect -# github.com/uptrace/bun/dialect/sqlitedialect v1.1.15 +# github.com/uptrace/bun/dialect/sqlitedialect v1.1.16 ## explicit; go 1.19 github.com/uptrace/bun/dialect/sqlitedialect -# github.com/uptrace/bun/extra/bunotel v1.1.15 +# github.com/uptrace/bun/extra/bunotel v1.1.16 ## explicit; go 1.19 github.com/uptrace/bun/extra/bunotel # github.com/uptrace/opentelemetry-go-extra/otelsql v0.2.2