MCPcopy
hub / github.com/jackc/pgx / Connect

Function Connect

pgconn/pgconn.go:115–122  ·  view source on GitHub ↗

Connect establishes a connection to a PostgreSQL server using the environment and connString (in URL or keyword/value format) to provide configuration. See documentation for [ParseConfig] for details. ctx can be used to cancel a connect attempt.

(ctx context.Context, connString string)

Source from the content-addressed store, hash-verified

113// format) to provide configuration. See documentation for [ParseConfig] for details. ctx can be used to cancel a
114// connect attempt.
115func Connect(ctx context.Context, connString string) (*PgConn, error) {
116 config, err := ParseConfig(connString)
117 if err != nil {
118 return nil, err
119 }
120
121 return ConnectConfig(ctx, config)
122}
123
124// Connect establishes a connection to a PostgreSQL server using the environment and connString (in URL or keyword/value
125// format) and ParseConfigOptions to provide additional configuration. See documentation for [ParseConfig] for details.

Calls 2

ParseConfigFunction · 0.70
ConnectConfigFunction · 0.70