From 3af0c6bde77f02fedf3d51629d4fa00d8e5ba57c Mon Sep 17 00:00:00 2001 From: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> Date: Tue, 18 Aug 2026 16:26:30 +0000 Subject: [PATCH 1/3] docs: add explicit Documentation section to README Link pkg.go.dev, the getting started wiki, and connection string docs so API reference is easy to find without relying on the badge alone. Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index aa35e4a3d..c8fd5501c 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,20 @@ func main() { See the [getting started guide](https://github.com/jackc/pgx/wiki/Getting-started-with-pgx) for more information. +## Documentation + +* **API reference (pkg.go.dev):** https://pkg.go.dev/github.com/jackc/pgx/v5 + Package docs for `pgx`, `pgxpool`, `stdlib` (`database/sql`), and related modules. +* **Getting started wiki:** https://github.com/jackc/pgx/wiki/Getting-started-with-pgx +* **Connection strings:** `pgx.Connect` and `pgxpool.New` accept the same URL or + keyword/value formats as libpq (for example + `postgres://user:pass@host:5432/db?sslmode=verify-full`). Parsing, defaults, and + supported `PG*` environment variables are documented on + [`pgconn.ParseConfig`](https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#ParseConfig) + and in the PostgreSQL + [connection string](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) + documentation. + ## Features * Support for approximately 70 different PostgreSQL types From 6c8cea4f4ef2377b5fcc7080da697af83a99408e Mon Sep 17 00:00:00 2001 From: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> Date: Fri, 21 Aug 2026 07:33:49 +0000 Subject: [PATCH 2/3] docs: integrate quick start and documentation into README - Add installation instructions (`go get github.com/jackc/pgx/v5`) - Group basic example and connection configuration under Quick Start - Provide structured Documentation links for pgx, pgxpool, and stdlib - Avoid duplicate links to the Getting Started wiki page Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> --- README.md | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c8fd5501c..e2a5724ca 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,15 @@ The toolkit component is a related set of packages that implement PostgreSQL fun and type mapping between PostgreSQL and Go. These underlying packages can be used to implement alternative drivers, proxies, load balancers, logical replication clients, etc. -## Example Usage +## Quick Start + +### Installation + +```bash +go get github.com/jackc/pgx/v5 +``` + +### Example Usage ```go package main @@ -29,7 +37,8 @@ func main() { // urlExample := "postgres://username:password@localhost:5432/database_name" conn, err := pgx.Connect(context.Background(), os.Getenv("DATABASE_URL")) if err != nil { - fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) + fmt.Fprintf(os.Stderr, "Unable to connect to database: %v +", err) os.Exit(1) } defer conn.Close(context.Background()) @@ -38,7 +47,8 @@ func main() { var weight int64 err = conn.QueryRow(context.Background(), "select name, weight from widgets where id=$1", 42).Scan(&name, &weight) if err != nil { - fmt.Fprintf(os.Stderr, "QueryRow failed: %v\n", err) + fmt.Fprintf(os.Stderr, "QueryRow failed: %v +", err) os.Exit(1) } @@ -46,21 +56,18 @@ func main() { } ``` -See the [getting started guide](https://github.com/jackc/pgx/wiki/Getting-started-with-pgx) for more information. +### Connection Configuration + +`pgx.Connect` and `pgxpool.New` accept PostgreSQL connection URLs (such as `postgres://user:pass@host:5432/db?sslmode=verify-full`) as well as `key=value` strings. See [`pgconn.ParseConfig`](https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#ParseConfig) and the [PostgreSQL connection string documentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) for supported options and environment variables. + +For a step-by-step walkthrough, see the [getting started guide](https://github.com/jackc/pgx/wiki/Getting-started-with-pgx). ## Documentation -* **API reference (pkg.go.dev):** https://pkg.go.dev/github.com/jackc/pgx/v5 - Package docs for `pgx`, `pgxpool`, `stdlib` (`database/sql`), and related modules. -* **Getting started wiki:** https://github.com/jackc/pgx/wiki/Getting-started-with-pgx -* **Connection strings:** `pgx.Connect` and `pgxpool.New` accept the same URL or - keyword/value formats as libpq (for example - `postgres://user:pass@host:5432/db?sslmode=verify-full`). Parsing, defaults, and - supported `PG*` environment variables are documented on - [`pgconn.ParseConfig`](https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#ParseConfig) - and in the PostgreSQL - [connection string](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) - documentation. +Package documentation and API reference are available on [pkg.go.dev](https://pkg.go.dev/github.com/jackc/pgx/v5): +* [`pgx`](https://pkg.go.dev/github.com/jackc/pgx/v5) — base PostgreSQL driver +* [`pgxpool`](https://pkg.go.dev/github.com/jackc/pgx/v5/pgxpool) — concurrency-safe connection pool +* [`stdlib`](https://pkg.go.dev/github.com/jackc/pgx/v5/stdlib) — `database/sql` compatibility adapter ## Features From 3bfc268f59bc0ed0e8dbbec3a4ee6dc7b8c2e16f Mon Sep 17 00:00:00 2001 From: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> Date: Fri, 21 Aug 2026 07:34:08 +0000 Subject: [PATCH 3/3] docs: clean up code formatting in README Quick Start Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com> --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e2a5724ca..bf6447722 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,7 @@ func main() { // urlExample := "postgres://username:password@localhost:5432/database_name" conn, err := pgx.Connect(context.Background(), os.Getenv("DATABASE_URL")) if err != nil { - fmt.Fprintf(os.Stderr, "Unable to connect to database: %v -", err) + fmt.Fprintf(os.Stderr, "Unable to connect to database: %v\n", err) os.Exit(1) } defer conn.Close(context.Background()) @@ -47,8 +46,7 @@ func main() { var weight int64 err = conn.QueryRow(context.Background(), "select name, weight from widgets where id=$1", 42).Scan(&name, &weight) if err != nil { - fmt.Fprintf(os.Stderr, "QueryRow failed: %v -", err) + fmt.Fprintf(os.Stderr, "QueryRow failed: %v\n", err) os.Exit(1) }