Skip to content

Commit

Permalink
SNOW-1814531 Implement DriverContext interface
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-pfus committed Nov 19, 2024
1 parent e05cc79 commit 7ef1e22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 0 additions & 1 deletion auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,6 @@ func TestOktaRetryWithNewToken(t *testing.T) {
}

func TestContextPropagatedToAuthWhenUsingOpen(t *testing.T) {
t.Skip("dsnConnector loses context when opening using sql.Open")
db, err := sql.Open("snowflake", dsn)
assertNilF(t, err)
defer db.Close()
Expand Down
8 changes: 8 additions & 0 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ func (d SnowflakeDriver) Open(dsn string) (driver.Conn, error) {
return d.OpenWithConfig(ctx, *cfg)
}

func (d SnowflakeDriver) OpenConnector(dsn string) (driver.Connector, error) {

Check failure on line 36 in driver.go

View workflow job for this annotation

GitHub Actions / Check linter

exported method SnowflakeDriver.OpenConnector should have comment or be unexported
cfg, err := ParseDSN(dsn)
if err != nil {
return Connector{}, err
}
return NewConnector(SnowflakeDriver{}, *cfg), nil
}

// OpenWithConfig creates a new connection with the given Config.
func (d SnowflakeDriver) OpenWithConfig(ctx context.Context, config Config) (driver.Conn, error) {
if err := config.Validate(); err != nil {
Expand Down

0 comments on commit 7ef1e22

Please sign in to comment.