Merge pull request #441 from cloudbase/dependabot/go_modules/gorm.io/datatypes-1.2.6
Bump gorm.io/datatypes from 1.2.5 to 1.2.6
This commit is contained in:
commit
9f5cf64542
4 changed files with 21 additions and 15 deletions
2
go.mod
2
go.mod
|
|
@ -34,7 +34,7 @@ require (
|
|||
golang.org/x/sync v0.15.0
|
||||
gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0
|
||||
gopkg.in/natefinch/lumberjack.v2 v2.2.1
|
||||
gorm.io/datatypes v1.2.5
|
||||
gorm.io/datatypes v1.2.6
|
||||
gorm.io/driver/mysql v1.6.0
|
||||
gorm.io/driver/sqlite v1.6.0
|
||||
gorm.io/gorm v1.30.0
|
||||
|
|
|
|||
8
go.sum
8
go.sum
|
|
@ -219,15 +219,15 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
|||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/datatypes v1.2.5 h1:9UogU3jkydFVW1bIVVeoYsTpLRgwDVW3rHfJG6/Ek9I=
|
||||
gorm.io/datatypes v1.2.5/go.mod h1:I5FUdlKpLb5PMqeMQhm30CQ6jXP8Rj89xkTeCSAaAD4=
|
||||
gorm.io/datatypes v1.2.6 h1:KafLdXvFUhzNeL2ncm03Gl3eTLONQfNKZ+wJ+9Y4Nck=
|
||||
gorm.io/datatypes v1.2.6/go.mod h1:M2iO+6S3hhi4nAyYe444Pcb0dcIiOMJ7QHaUXxyiNZY=
|
||||
gorm.io/driver/mysql v1.6.0 h1:eNbLmNTpPpTOVZi8MMxCi2aaIm0ZpInbORNXDwyLGvg=
|
||||
gorm.io/driver/mysql v1.6.0/go.mod h1:D/oCC2GWK3M/dqoLxnOlaNKmXz8WNTfcS9y5ovaSqKo=
|
||||
gorm.io/driver/postgres v1.5.0 h1:u2FXTy14l45qc3UeCJ7QaAXZmZfDDv0YrthvmRq1l0U=
|
||||
gorm.io/driver/postgres v1.5.0/go.mod h1:FUZXzO+5Uqg5zzwzv4KK49R8lvGIyscBOqYrtI1Ce9A=
|
||||
gorm.io/driver/sqlite v1.6.0 h1:WHRRrIiulaPiPFmDcod6prc4l2VGVWHz80KspNsxSfQ=
|
||||
gorm.io/driver/sqlite v1.6.0/go.mod h1:AO9V1qIQddBESngQUKWL9yoH93HIeA1X6V633rBwyT8=
|
||||
gorm.io/driver/sqlserver v1.5.4 h1:xA+Y1KDNspv79q43bPyjDMUgHoYHLhXYmdFcYPobg8g=
|
||||
gorm.io/driver/sqlserver v1.5.4/go.mod h1:+frZ/qYmuna11zHPlh5oc2O6ZA/lS88Keb0XSH1Zh/g=
|
||||
gorm.io/driver/sqlserver v1.6.0 h1:VZOBQVsVhkHU/NzNhRJKoANt5pZGQAS1Bwc6m6dgfnc=
|
||||
gorm.io/driver/sqlserver v1.6.0/go.mod h1:WQzt4IJo/WHKnckU9jXBLMJIVNMVeTu25dnOzehntWw=
|
||||
gorm.io/gorm v1.30.0 h1:qbT5aPv1UH8gI99OsRlvDToLxW5zR7FzS9acZDOZcgs=
|
||||
gorm.io/gorm v1.30.0/go.mod h1:8Z33v652h4//uMA76KjeDH8mJXPm1QNCYrMeatR0DOE=
|
||||
|
|
|
|||
24
vendor/gorm.io/datatypes/json.go
generated
vendored
24
vendor/gorm.io/datatypes/json.go
generated
vendored
|
|
@ -35,16 +35,20 @@ func (j *JSON) Scan(value interface{}) error {
|
|||
return nil
|
||||
}
|
||||
var bytes []byte
|
||||
switch v := value.(type) {
|
||||
case []byte:
|
||||
if len(v) > 0 {
|
||||
bytes = make([]byte, len(v))
|
||||
copy(bytes, v)
|
||||
if s, ok := value.(fmt.Stringer); ok {
|
||||
bytes = []byte(s.String())
|
||||
} else {
|
||||
switch v := value.(type) {
|
||||
case []byte:
|
||||
if len(v) > 0 {
|
||||
bytes = make([]byte, len(v))
|
||||
copy(bytes, v)
|
||||
}
|
||||
case string:
|
||||
bytes = []byte(v)
|
||||
default:
|
||||
return errors.New(fmt.Sprint("Failed to unmarshal JSONB value:", value))
|
||||
}
|
||||
case string:
|
||||
bytes = []byte(v)
|
||||
default:
|
||||
return errors.New(fmt.Sprint("Failed to unmarshal JSONB value:", value))
|
||||
}
|
||||
|
||||
result := json.RawMessage(bytes)
|
||||
|
|
@ -394,6 +398,8 @@ func (jsonSet *JSONSetExpression) Build(builder clause.Builder) {
|
|||
break
|
||||
}
|
||||
stmt.AddVar(builder, gorm.Expr("CAST(? AS JSON)", string(b)))
|
||||
case reflect.Bool:
|
||||
builder.WriteString(strconv.FormatBool(rv.Bool()))
|
||||
default:
|
||||
stmt.AddVar(builder, value)
|
||||
}
|
||||
|
|
|
|||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
|
|
@ -355,7 +355,7 @@ gopkg.in/natefinch/lumberjack.v2
|
|||
# gopkg.in/yaml.v3 v3.0.1
|
||||
## explicit
|
||||
gopkg.in/yaml.v3
|
||||
# gorm.io/datatypes v1.2.5
|
||||
# gorm.io/datatypes v1.2.6
|
||||
## explicit; go 1.19
|
||||
gorm.io/datatypes
|
||||
# gorm.io/driver/mysql v1.6.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue