Skip to content

Commit

Permalink
Support pgx versioned names
Browse files Browse the repository at this point in the history
This commit supports the driver names pgx/v4 and pgx/v5. These aliases
of different versions of pgx allow loading the proper driver if
a dependency of a project imports a different one.

Signed-off-by: Mariano Cano <[email protected]>
  • Loading branch information
maraino committed Aug 8, 2023
1 parent 8d836f2 commit 575a46e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const (
)

var defaultBinds = map[int][]string{
DOLLAR: []string{"postgres", "pgx", "pq-timeouts", "cloudsqlpostgres", "ql", "nrpostgres", "cockroach"},
DOLLAR: []string{"postgres", "pgx", "pgx/v4", "pgx/v5", "pq-timeouts", "cloudsqlpostgres", "ql", "nrpostgres", "cockroach"},
QUESTION: []string{"mysql", "sqlite3", "nrmysql", "nrsqlite3"},
NAMED: []string{"oci8", "ora", "goracle", "godror"},
AT: []string{"sqlserver"},
Expand Down
2 changes: 1 addition & 1 deletion bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

func oldBindType(driverName string) int {
switch driverName {
case "postgres", "pgx", "pq-timeouts", "cloudsqlpostgres", "ql":
case "postgres", "pgx", "pgx/v4", "pgx/v5", "pq-timeouts", "cloudsqlpostgres", "ql":
return DOLLAR
case "mysql":
return QUESTION
Expand Down

0 comments on commit 575a46e

Please sign in to comment.