Skip to content

Commit

Permalink
feat: change the connector dialer
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswuerbach committed May 10, 2022
1 parent 006a3f4 commit cf6aeee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conn.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 cf6aeee

Please sign in to comment.