Skip to content

Commit 06a0abb

Browse files
authored
Update pgxpool.ParseConfig documentation
Added default values and example of valid duration string to inline documentation.
1 parent c76a650 commit 06a0abb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pgxpool/pool.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -281,20 +281,20 @@ func NewWithConfig(ctx context.Context, config *Config) (*Pool, error) {
281281
// ParseConfig builds a Config from connString. It parses connString with the same behavior as [pgx.ParseConfig] with the
282282
// addition of the following variables:
283283
//
284-
// - pool_max_conns: integer greater than 0
285-
// - pool_min_conns: integer 0 or greater
286-
// - pool_max_conn_lifetime: duration string
287-
// - pool_max_conn_idle_time: duration string
288-
// - pool_health_check_period: duration string
289-
// - pool_max_conn_lifetime_jitter: duration string
284+
// - pool_max_conns: integer greater than 0 (default 4)
285+
// - pool_min_conns: integer 0 or greater (default 0)
286+
// - pool_max_conn_lifetime: duration string (default 1 hour)
287+
// - pool_max_conn_idle_time: duration string (default 30 minutes)
288+
// - pool_health_check_period: duration string (default 1 minute)
289+
// - pool_max_conn_lifetime_jitter: duration string (default 0)
290290
//
291291
// See Config for definitions of these arguments.
292292
//
293293
// # Example Keyword/Value
294-
// user=jack password=secret host=pg.example.com port=5432 dbname=mydb sslmode=verify-ca pool_max_conns=10
294+
// user=jack password=secret host=pg.example.com port=5432 dbname=mydb sslmode=verify-ca pool_max_conns=10 pool_max_conn_lifetime=1h30m
295295
//
296296
// # Example URL
297-
// postgres://jack:[email protected]:5432/mydb?sslmode=verify-ca&pool_max_conns=10
297+
// postgres://jack:[email protected]:5432/mydb?sslmode=verify-ca&pool_max_conns=10&pool_max_conn_lifetime=1h30m
298298
func ParseConfig(connString string) (*Config, error) {
299299
connConfig, err := pgx.ParseConfig(connString)
300300
if err != nil {

0 commit comments

Comments
 (0)