From d75362f39637443099c01fa19b1b0879af75c0b9 Mon Sep 17 00:00:00 2001 From: Johan Brandhorst Date: Sat, 7 Dec 2019 10:19:47 +0000 Subject: [PATCH] Add back GetDefaultDriver This method is useful when it is necessary to wrap the pgx stdlib driver, for example to add tracing and metrics. Fixes #645 --- stdlib/sql.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stdlib/sql.go b/stdlib/sql.go index 7e1d64fc..5803dd24 100644 --- a/stdlib/sql.go +++ b/stdlib/sql.go @@ -114,6 +114,12 @@ var ( fakeTxConns map[*pgx.Conn]*sql.Tx ) +// GetDefaultDriver returns the driver initialized in the init function +// and used when the pgx driver is registered. +func GetDefaultDriver() driver.Driver { + return pgxDriver +} + type Driver struct { configMutex sync.Mutex configs map[string]*pgx.ConnConfig