MCPcopy Index your code
hub / github.com/coder/coder / Open

Method Open

coderd/database/awsiamrds/awsiamrds.go:58–72  ·  view source on GitHub ↗

Open creates a new connection to the database using the provided name.

(name string)

Source from the content-addressed store, hash-verified

56
57// Open creates a new connection to the database using the provided name.
58func (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.
75func (d *awsIamRdsDriver) Connector(name string) (driver.Connector, error) {

Callers 1

RegisterFunction · 0.45

Calls 2

getAuthenticatedURLFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected