refactor: Update gorm deps (#1591)
Our recent upstream PR was merged into gorm. We needed to change just a few bits to migrate our gorm dep back to the upstream source.
This commit is contained in:
5 files changed
+7
-16
No files matched your search
@@ -6,10 +6,6 @@ replace github.com/hashicorp/boundary/api => ./api
|
||||
|
||||
replace github.com/hashicorp/boundary/sdk => ./sdk
|
||||
|
||||
// tmp use of local clone as we understand any required upstream PRs to
|
||||
// compatibility.
|
||||
replace gorm.io/gorm => github.com/hashicorp/gorm v0.0.2
|
||||
|
||||
require (
|
||||
github.com/armon/go-metrics v0.3.9
|
||||
github.com/bufbuild/buf v0.37.0
|
||||
@@ -83,7 +79,7 @@ require (
|
||||
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0
|
||||
google.golang.org/protobuf v1.27.1
|
||||
gorm.io/driver/postgres v1.1.0
|
||||
gorm.io/gorm v1.21.14
|
||||
gorm.io/gorm v1.21.17-0.20211013130203-9a5ba3760424
|
||||
mvdan.cc/gofumpt v0.1.1
|
||||
nhooyr.io/websocket v1.8.7
|
||||
)
|
||||
@@ -538,8 +538,6 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
|
||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||
github.com/hashicorp/golang-lru v0.5.3 h1:YPkqC67at8FYaadspW/6uE0COsBxS2656RLEr8Bppgk=
|
||||
github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4=
|
||||
github.com/hashicorp/gorm v0.0.2 h1:yxEp0og8mswtQVSEnxEsU+d3QIvYDqU+P5ABAm0B9n4=
|
||||
github.com/hashicorp/gorm v0.0.2/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
|
||||
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
|
||||
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
@@ -1518,6 +1516,9 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/driver/postgres v1.1.0 h1:afBljg7PtJ5lA6YUWluV2+xovIPhS+YiInuL3kUjrbk=
|
||||
gorm.io/driver/postgres v1.1.0/go.mod h1:hXQIwafeRjJvUm+OMxcFWyswJ/vevcpPLlGocwAwuqw=
|
||||
gorm.io/gorm v1.21.9/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
|
||||
gorm.io/gorm v1.21.17-0.20211013130203-9a5ba3760424 h1:BIsspdRVnFmC32WxhF+4rvNu/mU/rbX9yK9a8vtJSqs=
|
||||
gorm.io/gorm v1.21.17-0.20211013130203-9a5ba3760424/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0=
|
||||
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
|
||||
gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw=
|
||||
gotest.tools/v3 v3.0.2 h1:kG1BFyqVHuQoVQiR1bWGnfz/fmHvvuiSPIV7rvl360E=
|
||||
|
||||
@@ -7,9 +7,7 @@ Just some high-level usage highlights to get you started. Read the godocs for a
|
||||
dialect = postgres.New(postgres.Config{
|
||||
DSN: connectionUrl},
|
||||
)
|
||||
conn, _ := gorm.Open(dialect, &gorm.Config{
|
||||
ConvertNullToZeroValues: true,
|
||||
})
|
||||
conn, _ := gorm.Open(dialect, &gorm.Config{})
|
||||
|
||||
// Db implements both the Reader and Writer interfaces
|
||||
rw := Db{Tx: conn}
|
||||
|
||||
+1
-3
@@ -87,9 +87,7 @@ func Open(dbType DbType, connectionUrl string, opt ...Option) (*DB, error) {
|
||||
default:
|
||||
return nil, fmt.Errorf("unable to open %s database type", dbType)
|
||||
}
|
||||
db, err := gorm.Open(dialect, &gorm.Config{
|
||||
ConvertNullToZeroValues: true,
|
||||
})
|
||||
db, err := gorm.Open(dialect, &gorm.Config{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to open database: %w", err)
|
||||
}
|
||||
|
||||
@@ -47,9 +47,7 @@ func testOpen(dbType string, connectionUrl string) (*gorm.DB, error) {
|
||||
default:
|
||||
return nil, fmt.Errorf("unable to open %s database type", dbType)
|
||||
}
|
||||
db, err := gorm.Open(dialect, &gorm.Config{
|
||||
ConvertNullToZeroValues: true,
|
||||
})
|
||||
db, err := gorm.Open(dialect, &gorm.Config{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to open database: %w", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user