Skip to content

Commit

Permalink
Merge pull request #1082 from johanneswuerbach/connector-dialer
Browse files Browse the repository at this point in the history
feat: change the connector dialer
  • Loading branch information
rafiss committed May 11, 2022
2 parents 30d9faf + cf6aeee commit 54a3a4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conn.go
Expand Up @@ -322,7 +322,7 @@ func DialOpen(d Dialer, dsn string) (_ driver.Conn, err error) {
if err != nil {
return nil, err
}
c.dialer = d
c.Dialer(d)
return c.open(context.Background())
}

Expand Down
5 changes: 5 additions & 0 deletions connector.go
Expand Up @@ -27,6 +27,11 @@ func (c *Connector) Connect(ctx context.Context) (driver.Conn, error) {
return c.open(ctx)
}

// Dialer allows change the dialer used to open connections.
func (c *Connector) Dialer(dialer Dialer) {
c.dialer = dialer
}

// Driver returns the underlying driver of this Connector.
func (c *Connector) Driver() driver.Driver {
return &Driver{}
Expand Down

0 comments on commit 54a3a4b

Please sign in to comment.