From 575a46e5dd93e52f3e1fe60827b6aaf2c0416396 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Tue, 8 Aug 2023 11:49:32 -0700 Subject: [PATCH] Support pgx versioned names 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 --- bind.go | 2 +- bind_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bind.go b/bind.go index 8a00a9e..33938bd 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 dfa590e..cce3543 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