Skip to content

Commit 96d73fd

Browse files
authored
Upgrade lib/pq to v1.11.2 (#7283)
1 parent ee2028a commit 96d73fd

50 files changed

Lines changed: 3920 additions & 2427 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ require (
3131
github.com/hashicorp/memberlist v0.5.4
3232
github.com/json-iterator/go v1.1.12
3333
github.com/klauspost/compress v1.18.2
34-
github.com/lib/pq v1.10.9
34+
github.com/lib/pq v1.11.2 // indirect
3535
github.com/minio/minio-go/v7 v7.0.98
3636
github.com/mitchellh/go-wordwrap v1.0.1
3737
github.com/oklog/ulid v1.3.1

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,8 +1482,8 @@ github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1
14821482
github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353 h1:X/79QL0b4YJVO5+OsPH9rF2u428CIrGL/jLmPsoOQQ4=
14831483
github.com/leesper/go_rng v0.0.0-20190531154944-a612b043e353/go.mod h1:N0SVk0uhy+E1PZ3C9ctsPRlvOPAFPkCNlcPBDkt0N3U=
14841484
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
1485-
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
1486-
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
1485+
github.com/lib/pq v1.11.2 h1:x6gxUeu39V0BHZiugWe8LXZYZ+Utk7hSJGThs8sdzfs=
1486+
github.com/lib/pq v1.11.2/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA=
14871487
github.com/linode/linodego v1.60.0 h1:SgsebJFRCi+lSmYy+C40wmKZeJllGGm+W12Qw4+yVdI=
14881488
github.com/linode/linodego v1.60.0/go.mod h1:1+Bt0oTz5rBnDOJbGhccxn7LYVytXTIIfAy7QYmijDs=
14891489
github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA=

pkg/configs/db/postgres/postgres.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import (
1616
"github.com/golang-migrate/migrate/v4"
1717
_ "github.com/golang-migrate/migrate/v4/database/postgres" // Import the postgres migrations driver
1818
_ "github.com/golang-migrate/migrate/v4/source/file" // Import the postgres migrations driver
19-
"github.com/lib/pq" // Import the postgres sql driver
2019
"github.com/pkg/errors"
2120
)
2221

@@ -120,7 +119,7 @@ func (d DB) findConfigs(filter squirrel.Sqlizer) (map[string]userconfig.View, er
120119
var cfg userconfig.View
121120
var cfgBytes []byte
122121
var userID string
123-
var deletedAt pq.NullTime
122+
var deletedAt sql.NullTime
124123
err = rows.Scan(&cfg.ID, &userID, &cfgBytes, &deletedAt)
125124
if err != nil {
126125
return nil, err
@@ -146,7 +145,7 @@ func (d DB) findConfigs(filter squirrel.Sqlizer) (map[string]userconfig.View, er
146145
func (d DB) GetConfig(ctx context.Context, userID string) (userconfig.View, error) {
147146
var cfgView userconfig.View
148147
var cfgBytes []byte
149-
var deletedAt pq.NullTime
148+
var deletedAt sql.NullTime
150149
err := d.Select("id", "config", "deleted_at").
151150
From("configs").
152151
Where(squirrel.And{allConfigs, squirrel.Eq{"owner_id": userID}}).
@@ -257,7 +256,7 @@ func (d DB) findRulesConfigs(filter squirrel.Sqlizer) (map[string]userconfig.Ver
257256
var userID string
258257
var cfgBytes []byte
259258
var rfvBytes []byte
260-
var deletedAt pq.NullTime
259+
var deletedAt sql.NullTime
261260
err = rows.Scan(&cfg.ID, &userID, &cfgBytes, &rfvBytes, &deletedAt)
262261
if err != nil {
263262
return nil, err
@@ -303,7 +302,7 @@ func (d DB) GetRulesConfigs(ctx context.Context, since userconfig.ID) (map[strin
303302
// SetDeletedAtConfig sets a deletedAt for configuration
304303
// by adding a single new row with deleted_at set
305304
// the same as SetConfig is actually insert
306-
func (d DB) SetDeletedAtConfig(ctx context.Context, userID string, deletedAt pq.NullTime, cfg userconfig.Config) error {
305+
func (d DB) SetDeletedAtConfig(ctx context.Context, userID string, deletedAt sql.NullTime, cfg userconfig.Config) error {
307306
cfgBytes, err := json.Marshal(cfg)
308307
if err != nil {
309308
return err
@@ -321,7 +320,7 @@ func (d DB) DeactivateConfig(ctx context.Context, userID string) error {
321320
if err != nil {
322321
return err
323322
}
324-
return d.SetDeletedAtConfig(ctx, userID, pq.NullTime{Time: time.Now(), Valid: true}, cfg.Config)
323+
return d.SetDeletedAtConfig(ctx, userID, sql.NullTime{Time: time.Now(), Valid: true}, cfg.Config)
325324
}
326325

327326
// RestoreConfig restores configuration.
@@ -330,7 +329,7 @@ func (d DB) RestoreConfig(ctx context.Context, userID string) error {
330329
if err != nil {
331330
return err
332331
}
333-
return d.SetDeletedAtConfig(ctx, userID, pq.NullTime{}, cfg.Config)
332+
return d.SetDeletedAtConfig(ctx, userID, sql.NullTime{}, cfg.Config)
334333
}
335334

336335
// Transaction runs the given function in a postgres transaction. If fn returns

vendor/github.com/lib/pq/.gitattributes

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/lib/pq/CHANGELOG.md

Lines changed: 157 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/lib/pq/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/lib/pq/LICENSE.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

vendor/github.com/lib/pq/README.md

Lines changed: 70 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)