Skip to content

Commit

Permalink
Adding a check to pass dburl.URL.GoDriver to sql.Open
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Aug 16, 2023
1 parent b2c6cce commit 5844f84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/drivers.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ func Open(ctx context.Context, u *dburl.URL, stdout, stderr func() io.Writer) (*
return nil, WrapErr(u.Driver, err)
}
}
db, err := f(u.Driver, u.DSN)
driver := u.Driver
if u.GoDriver != "" {
driver = u.GoDriver
}
db, err := f(driver, u.DSN)
if err != nil {
return nil, WrapErr(u.Driver, err)
}
Expand Down

0 comments on commit 5844f84

Please sign in to comment.