Registry / database / jackc-pgx-v5

jackc-pgx-v5

JSON →
library5.10.0gogounverified

Package pgx is a PostgreSQL database driver and toolkit for Go.

go get github.com/jackc/pgx/v5
INSTALL
IMPORT
SIG · JACKC-PGX-V5
J
jackc-pgx-v5
databasegov5.10.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pgx
github.com/jackc/pgx/v5

Connect to PostgreSQL and run a simple query.

package main import ( "context" "fmt" "github.com/jackc/pgx/v5" ) func main() { conn, err := pgx.Connect(context.Background(), "postgres://username:password@localhost:5432/database") if err != nil { fmt.Println(err) return } defer conn.Close(context.Background()) var greeting string err = conn.QueryRow(context.Background(), "select 'Hello, world!'").Scan(&greeting) if err != nil { fmt.Println(err) return } fmt.Println(greeting) }
Debug
Known issues
breakingpgx v5 has breaking changes from v4, including removal of the pgxpool package (moved to separate module) and changes to the connection config.
fix
Use github.com/jackc/pgx/v5/pgxpool for connection pooling and update import paths accordingly.
affects: >=5.0.0
Upgrade
Version history
5.10.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
Resources
jackc-pgx-v5 — go get jackc-pgx-v5 · libregistry