Skip to content

Commit

Permalink
go.d postgres github.com/jackc/pgx/v5 (netdata#18062)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Jul 2, 2024
1 parent c573ad7 commit 62a004b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 146 deletions.
8 changes: 2 additions & 6 deletions src/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ require (
github.com/golang/mock v1.6.0
github.com/gosnmp/gosnmp v1.37.0
github.com/ilyam8/hashstructure v1.1.0
github.com/jackc/pgx/v4 v4.18.3
github.com/jackc/pgx/v5 v5.6.0
github.com/jessevdk/go-flags v1.6.1
github.com/kanocz/fcgi_client v0.0.0-20210113082628-fff85c8adfb7
github.com/likexian/whois v1.15.3
Expand Down Expand Up @@ -88,13 +88,9 @@ require (
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.14.3 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/josharian/native v1.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down
135 changes: 4 additions & 131 deletions src/go/go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/go/plugin/go.d/modules/pgbouncer/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"time"

"github.com/blang/semver/v4"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/stdlib"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/stdlib"
)

// 'SHOW STATS;' response was changed significantly in v1.8.0
Expand Down Expand Up @@ -264,7 +264,7 @@ func (p *PgBouncer) openConnection() error {
if err != nil {
return err
}
cfg.PreferSimpleProtocol = true
cfg.DefaultQueryExecMode = pgx.QueryExecModeSimpleProtocol

db, err := sql.Open("pgx", stdlib.RegisterConnConfig(cfg))
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion src/go/plugin/go.d/modules/pgbouncer/pgbouncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web"

"github.com/blang/semver/v4"
_ "github.com/jackc/pgx/v4/stdlib"
_ "github.com/jackc/pgx/v5/stdlib"
)

//go:embed "config_schema.json"
Expand Down
4 changes: 2 additions & 2 deletions src/go/plugin/go.d/modules/postgres/collect.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"strconv"
"time"

"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/stdlib"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/stdlib"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion src/go/plugin/go.d/modules/postgres/do_query_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"database/sql"
"strconv"

"github.com/jackc/pgx/v4/stdlib"
"github.com/jackc/pgx/v5/stdlib"
)

func (p *Postgres) doQueryServerVersion() (int, error) {
Expand Down
4 changes: 2 additions & 2 deletions src/go/plugin/go.d/modules/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/metrics"
"github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/web"

"github.com/jackc/pgx/v4/stdlib"
_ "github.com/jackc/pgx/v4/stdlib"
"github.com/jackc/pgx/v5/stdlib"
_ "github.com/jackc/pgx/v5/stdlib"
)

//go:embed "config_schema.json"
Expand Down

0 comments on commit 62a004b

Please sign in to comment.