Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d75362f

Browse files
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 jackc#645
1 parent 3dc25d5 commit d75362f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

stdlib/sql.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ var (
114114
fakeTxConns map[*pgx.Conn]*sql.Tx
115115
)
116116

117+
// GetDefaultDriver returns the driver initialized in the init function
118+
// and used when the pgx driver is registered.
119+
func GetDefaultDriver() driver.Driver {
120+
return pgxDriver
121+
}
122+
117123
type Driver struct {
118124
configMutex sync.Mutex
119125
configs map[string]*pgx.ConnConfig

0 commit comments

Comments
 (0)