OpenPostgres calls OpenPostgresURL with the URL parsed from urlstr. OpenPostgres is safe to call from multiple goroutines.
(ctx context.Context, urlstr string)
| 89 | // OpenPostgres calls OpenPostgresURL with the URL parsed from urlstr. |
| 90 | // OpenPostgres is safe to call from multiple goroutines. |
| 91 | func (mux *URLMux) OpenPostgres(ctx context.Context, urlstr string) (*sql.DB, error) { |
| 92 | opener, u, err := mux.schemes.FromString("DB", urlstr) |
| 93 | if err != nil { |
| 94 | return nil, err |
| 95 | } |
| 96 | return opener.(PostgresURLOpener).OpenPostgresURL(ctx, u) |
| 97 | } |
| 98 | |
| 99 | // OpenPostgresURL dispatches the URL to the opener that is registered with the |
| 100 | // URL's scheme. OpenPostgresURL is safe to call from multiple goroutines. |
no test coverage detected