Connect establishes a connection to a PostgreSQL server using the environment and connString (in URL or keyword/value format) and ParseConfigOptions to provide additional configuration. See documentation for [ParseConfig] for details. ctx can be used to cancel a connect attempt.
(ctx context.Context, connString string, parseConfigOptions ParseConfigOptions)
| 125 | // format) and ParseConfigOptions to provide additional configuration. See documentation for [ParseConfig] for details. |
| 126 | // ctx can be used to cancel a connect attempt. |
| 127 | func ConnectWithOptions(ctx context.Context, connString string, parseConfigOptions ParseConfigOptions) (*PgConn, error) { |
| 128 | config, err := ParseConfigWithOptions(connString, parseConfigOptions) |
| 129 | if err != nil { |
| 130 | return nil, err |
| 131 | } |
| 132 | |
| 133 | return ConnectConfig(ctx, config) |
| 134 | } |
| 135 | |
| 136 | // Connect establishes a connection to a PostgreSQL server using config. config must have been constructed with |
| 137 | // [ParseConfig]. ctx can be used to cancel a connect attempt. |