Open creates a new connection to the database using the provided name.
(name string)
| 56 | |
| 57 | // Open creates a new connection to the database using the provided name. |
| 58 | func (d *awsIamRdsDriver) Open(name string) (driver.Conn, error) { |
| 59 | // set password with signed aws authentication token for the rds instance |
| 60 | nURL, err := getAuthenticatedURL(d.cfg, name) |
| 61 | if err != nil { |
| 62 | return nil, xerrors.Errorf("assigning authentication token to url: %w", err) |
| 63 | } |
| 64 | |
| 65 | // make connection |
| 66 | conn, err := d.parent.Open(nURL) |
| 67 | if err != nil { |
| 68 | return nil, xerrors.Errorf("opening connection with %s: %w", nURL, err) |
| 69 | } |
| 70 | |
| 71 | return conn, nil |
| 72 | } |
| 73 | |
| 74 | // Connector returns a driver.Connector that fetches a new authentication token for each connection. |
| 75 | func (d *awsIamRdsDriver) Connector(name string) (driver.Connector, error) { |
no test coverage detected