Skip to content

Commit

Permalink
Merge pull request #102 from timescale/vperez/make-sure-connect-uses-…
Browse files Browse the repository at this point in the history
…pgxv5
  • Loading branch information
MetalBlueberry authored Dec 4, 2024
2 parents 88b1c2d + f2591d4 commit d8a7672
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ func Connect(connStr string, overrides ...Overrideable) (*sqlx.DB, error) {
if err != nil {
return nil, fmt.Errorf("could not connect: %v", err)
}
db, err := sqlx.Connect("pgx", mcc.DSN())
// It is required to connect using pgx/v5
// otherwise it may use pgx/v4 if that librariy is registered first
db, err := sqlx.Connect("pgx/v5", mcc.DSN())
if err != nil {
return nil, fmt.Errorf("could not connect: %v", err)
}
Expand Down

0 comments on commit d8a7672

Please sign in to comment.