Skip to content

Commit 66c80a7

Browse files
sirwarttejasmanohar
authored andcommitted
Support creating a driver directly without registering it (#3)
In some cases it's useful to reuse drivers to prevent leaking drivers every time a connection is opened. This allows library users to register the driver themselves and reuse the registered name when necessary.
1 parent 5b371a6 commit 66c80a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

driver.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ type Driver struct {
2323
cfg *Config
2424
}
2525

26+
func NewDriver(cfg *Config) *Driver {
27+
return &Driver{cfg}
28+
}
29+
2630
func init() {
2731
var drv driver.Driver = &Driver{}
2832
sql.Register("athena", drv)

0 commit comments

Comments
 (0)