Registry / database / jackc-pgx-v4

jackc-pgx-v4

JSON →
library4.18.3gogounverified

Package pgx is a PostgreSQL database driver for Go.

go get github.com/jackc/pgx/v4
INSTALL
IMPORT
SIG · JACKC-PGX-V4
J
jackc-pgx-v4
databasegov4.18.3
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/v4

Connect to PostgreSQL and run a simple query.

package main import ( "context" "fmt" "github.com/jackc/pgx/v4" ) func main() { conn, err := pgx.Connect(context.Background(), "postgres://user:password@localhost/dbname") if err != nil { panic(err) } defer conn.Close(context.Background()) var greeting string err = conn.QueryRow(context.Background(), "select 'Hello, world!'").Scan(&greeting) if err != nil { panic(err) } fmt.Println(greeting) }
Debug
Known issues
breakingpgx v4 is in maintenance mode; consider upgrading to v5 for new features.
fix
Migrate to github.com/jackc/pgx/v5
affects: >=4.0.0 <5.0.0
Upgrade
Version history
4.18.3latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
jackc-pgx-v4 — go get jackc-pgx-v4 · libregistry