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)
| 113 | // format) to provide configuration. See documentation for [ParseConfig] for details. ctx can be used to cancel a |
| 114 | // connect attempt. |
| 115 | func 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. |