2
0

Use Go 1.20's link syntax for ParseConfig

This commit is contained in:
Alexey Palazhchenko
2023-07-27 17:47:11 +04:00
committed by Jack Christensen
parent f4533dc906
commit 8fb309c631
6 changed files with 16 additions and 17 deletions
+2 -3
View File
@@ -4,13 +4,12 @@ pgxpool implements a nearly identical interface to pgx connections.
Creating a Pool
The primary way of creating a pool is with `pgxpool.New`.
The primary way of creating a pool is with [pgxpool.New]:
pool, err := pgxpool.New(context.Background(), os.Getenv("DATABASE_URL"))
The database connection string can be in URL or DSN format. PostgreSQL settings, pgx settings, and pool settings can be
specified here. In addition, a config struct can be created by `ParseConfig` and modified before establishing the
connection with `ConnectConfig`.
specified here. In addition, a config struct can be created by [ParseConfig].
config, err := pgxpool.ParseConfig(os.Getenv("DATABASE_URL"))
if err != nil {