From ec00a8edfca2b5574610a86be46b42504bd6591b Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Wed, 31 May 2023 15:07:00 -0700 Subject: [PATCH] Support pgx versioned names This commit adds support for the driver names pgx/v4 and pgx/v5. These aliases of different versions of pgx allows loading the proper driver if a dependency of a project imports a different one. Signed-off-by: Mariano Cano --- bind.go | 2 +- bind_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bind.go b/bind.go index ec0da4e7..21de94ba 100644 --- a/bind.go +++ b/bind.go @@ -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"}, diff --git a/bind_test.go b/bind_test.go index dfa590ec..cce35439 100644 --- a/bind_test.go +++ b/bind_test.go @@ -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