Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can fetch meta data from Driver #47

Merged
merged 1 commit into from
Jul 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fetch credientical from Driver.cfg
  • Loading branch information
Yancey1989 committed Jul 29, 2019
commit 26ccd47daf96fc8e32224e2f68c55e9ef4881570
10 changes: 6 additions & 4 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ func init() {
}

// impls database/sql/driver.Driver
type Driver struct{}
type Driver struct {
cfg *Config
}

func (d Driver) Open(dsn string) (driver.Conn, error) {
cfg, err := ParseDSN(dsn)
if err != nil {
var err error
if d.cfg, err = ParseDSN(dsn); err != nil {
return nil, err
}
return &odpsConn{&http.Client{}, cfg}, nil
return &odpsConn{&http.Client{}, d.cfg}, nil
}