MCPcopy Create free account
hub / github.com/google/go-cloud / OpenPostgres

Method OpenPostgres

postgres/postgres.go:91–97  ·  view source on GitHub ↗

OpenPostgres calls OpenPostgresURL with the URL parsed from urlstr. OpenPostgres is safe to call from multiple goroutines.

(ctx context.Context, urlstr string)

Source from the content-addressed store, hash-verified

89// OpenPostgres calls OpenPostgresURL with the URL parsed from urlstr.
90// OpenPostgres is safe to call from multiple goroutines.
91func (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.

Callers 1

OpenFunction · 0.80

Calls 2

FromStringMethod · 0.80
OpenPostgresURLMethod · 0.65

Tested by

no test coverage detected