An open API service for producing an overview of a list of open source projects.

https://github.com/jackc/pgx

Score: 37.80146182066283

Last synced: about 12 hours ago
JSON representation

Repository metadata:

PostgreSQL driver and toolkit for Go


Owner metadata:


GitHub Events

Total
Last Year

Committers metadata

Last synced: 3 days ago

Total Commits: 3,728
Total Committers: 384
Avg Commits per committer: 9.708
Development Distribution Score (DDS): 0.266

Commits in past year: 181
Committers in past year: 45
Avg Commits per committer in past year: 4.022
Development Distribution Score (DDS) in past year: 0.42

Name Email Commits
Jack Christensen j****k@j****m 2738
Manni Wood m****d@g****m 48
Artemiy Ryabinkov g****g@y****u 28
Kris Wehner k****s@y****m 23
Nicola Murino n****o@g****m 21
Maxim Ivanov h****b@y****e 20
Evan Jones e****j@e****a 19
merlin c****o@g****m 19
georgysavva g****a@g****m 17
Dmitry K c****4@g****m 16
James Hartig m****e@j****m 12
Oleksandr Redko O****o@e****m 12
Yuli Khodorkovskiy y****i@c****m 10
Lev Zakharov l****v@g****m 10
Karl Seguin k****l@o****o 10
WGH w****h@t****u 8
Andy Walker w****j@g****m 7
Felix Geisendörfer f****x@d****m 7
Felix Röhrich f****o@r****e 7
Kelsey Francis k****s@g****m 7
Mark Chambers m****s@g****m 7
Sean Chittenden s****n@c****g 7
ngavinsir n****r@g****m 7
Pavlo Golub p****b@g****m 6
Mathias Bogaert m****t@g****m 6
Jim Tsao j****o 6
Jacob Powers j****s@2****m 6
Phil Constantinou c****u@g****m 6
Stepan Rabotkin e****t@g****m 6
bakape b****e@g****m 6
and 354 more...

Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 555
Total pull requests: 423
Average time to close issues: 4 months
Average time to close pull requests: 2 months
Total issue authors: 484
Total pull request authors: 200
Average comments per issue: 3.69
Average comments per pull request: 1.91
Merged pull request: 235
Bot issues: 0
Bot pull requests: 0

Past year issues: 65
Past year pull requests: 103
Past year average time to close issues: 28 days
Past year average time to close pull requests: 10 days
Past year issue authors: 61
Past year pull request authors: 66
Past year average comments per issue: 2.28
Past year average comments per pull request: 1.15
Past year merged pull request: 34
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/jackc/pgx

Top Issue Authors

  • jackc (8)
  • mitar (5)
  • redbaron (5)
  • jacobmikesell (5)
  • aoifemode (4)
  • jameshartig (4)
  • janisz (3)
  • jwreschnig-utiq (3)
  • kaber2 (3)
  • danicc097 (3)
  • KoNekoD (2)
  • sai-sy (2)
  • jaltavilla (2)
  • Gnyblast (2)
  • igkg (2)

Top Pull Request Authors

  • jackc (29)
  • alexandear (18)
  • evanj (16)
  • mitar (7)
  • nicois (7)
  • felix-roehrich (7)
  • pashagolub (6)
  • exekias (6)
  • jameshartig (5)
  • flimzy (5)
  • abrightwell (5)
  • drakkan (5)
  • Jrmy2402 (4)
  • cuong-mudah (4)
  • bonnefoa (4)

Top Issue Labels

  • bug (215)
  • question (16)
  • needs response (5)
  • enhancement (4)
  • help wanted (3)
  • RFC (3)
  • v4 (2)

Top Pull Request Labels

  • documentation (3)
  • needs response (3)
  • help wanted (2)
  • enhancement (2)

Package metadata

proxy.golang.org: github.com/jackc/pgx/v4

Package pgx is a PostgreSQL database driver.

proxy.golang.org: github.com/jackc/pgx

Package pgx is a PostgreSQL database driver.

proxy.golang.org: github.com/jackc/pgx/v5

Package pgx is a PostgreSQL database driver.

proxy.golang.org: github.com/jackc/pgx/v5/pgproto3

Package pgproto3 is an encoder and decoder of the PostgreSQL wire protocol version 3. The primary interfaces are Frontend and Backend. They correspond to a client and server respectively. Messages are sent with Send (or a specialized Send variant). Messages are automatically buffered to minimize small writes. Call Flush to ensure a message has actually been sent. The Trace method of Frontend and Backend can be used to examine the wire-level message traffic. It outputs in a similar format to the PQtrace function in libpq. See https://www.postgresql.org/docs/current/protocol-message-formats.html for meanings of the different messages.

proxy.golang.org: github.com/jackc/pgx/v5/tracelog

Package tracelog provides a tracer that acts as a traditional logger.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/v5/tracelog#section-documentation
  • Licenses: MIT
  • Latest release: v5.9.2 (published about 1 month ago)
  • Last Synced: 2026-05-28T19:48:23.025Z (2 days ago)
  • Versions: 38
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 0.774%
    • Forks count: 1.049%
    • Average: 3.519%
    • Dependent packages count: 5.929%
    • Dependent repos count: 6.326%
proxy.golang.org: github.com/JackC/pgx

Package pgx is a PostgreSQL database driver.

  • Homepage: https://github.com/JackC/pgx
  • Documentation: https://pkg.go.dev/github.com/JackC/pgx#section-documentation
  • Licenses: MIT
  • Latest release: v3.6.2+incompatible (published over 6 years ago)
  • Last Synced: 2026-05-28T19:48:07.646Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Rankings:
    • Stargazers count: 0.795%
    • Forks count: 1.137%
    • Average: 4.062%
    • Dependent repos count: 4.738%
    • Dependent packages count: 9.576%
proxy.golang.org: github.com/jackC/pgx

Package pgx is a PostgreSQL database driver.

  • Homepage: https://github.com/jackC/pgx
  • Documentation: https://pkg.go.dev/github.com/jackC/pgx#section-documentation
  • Licenses: MIT
  • Latest release: v3.6.2+incompatible (published over 6 years ago)
  • Last Synced: 2026-05-28T19:48:04.734Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 0.541%
    • Forks count: 0.741%
    • Average: 4.407%
    • Dependent packages count: 6.999%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/Jackc/pgx

Package pgx is a PostgreSQL database driver. pgx provides lower level access to PostgreSQL than the standard database/sql. It remains as similar to the database/sql interface as possible while providing better speed and access to PostgreSQL specific features. Import github.com/jackc/pgx/stdlib to use pgx as a database/sql compatible driver. pgx implements Query and Scan in the familiar database/sql style. pgx also implements QueryRow in the same style as database/sql. Use Exec to execute a query that does not return a result set. Connection pool usage is explicit and configurable. In pgx, a connection can be created and managed directly, or a connection pool with a configurable maximum connections can be used. The connection pool offers an after connect hook that allows every connection to be automatically setup before being made available in the connection pool. It delegates methods such as QueryRow to an automatically checked out and released connection so you can avoid manually acquiring and releasing connections when you do not need that level of control. pgx maps between all common base types directly between Go and PostgreSQL. In particular: pgx can map nulls in two ways. The first is package pgtype provides types that have a data field and a status field. They work in a similar fashion to database/sql. The second is to use a pointer to a pointer. pgx maps between int16, int32, int64, float32, float64, and string Go slices and the equivalent PostgreSQL array type. Go slices of native types do not support nulls, so if a PostgreSQL array that contains a null is read into a native Go slice an error will occur. The pgtype package includes many more array types for PostgreSQL types that do not directly map to native Go types. pgx includes built-in support to marshal and unmarshal between Go types and the PostgreSQL JSON and JSONB. pgx encodes from net.IPNet to and from inet and cidr PostgreSQL types. In addition, as a convenience pgx will encode from a net.IP; it will assume a /32 netmask for IPv4 and a /128 for IPv6. pgx includes support for the common data types like integers, floats, strings, dates, and times that have direct mappings between Go and SQL. In addition, pgx uses the github.com/jackc/pgx/pgtype library to support more types. See documention for that library for instructions on how to implement custom types. See example_custom_type_test.go for an example of a custom type for the PostgreSQL point type. pgx also includes support for custom types implementing the database/sql.Scanner and database/sql/driver.Valuer interfaces. If pgx does cannot natively encode a type and that type is a renamed type (e.g. type MyTime time.Time) pgx will attempt to encode the underlying type. While this is usually desired behavior it can produce suprising behavior if one the underlying type and the renamed type each implement database/sql interfaces and the other implements pgx interfaces. It is recommended that this situation be avoided by implementing pgx interfaces on the renamed type. []byte passed as arguments to Query, QueryRow, and Exec are passed unmodified to PostgreSQL. Transactions are started by calling Begin or BeginEx. The BeginEx variant can create a transaction with a specified isolation level. Use CopyFrom to efficiently insert multiple rows at a time using the PostgreSQL copy protocol. CopyFrom accepts a CopyFromSource interface. If the data is already in a [][]interface{} use CopyFromRows to wrap it in a CopyFromSource interface. Or implement CopyFromSource to avoid buffering the entire data set in memory. CopyFrom can be faster than an insert with as few as 5 rows. pgx can listen to the PostgreSQL notification system with the WaitForNotification function. It takes a maximum time to wait for a notification. The pgx ConnConfig struct has a TLSConfig field. If this field is nil, then TLS will be disabled. If it is present, then it will be used to configure the TLS connection. This allows total configuration of the TLS connection. pgx has never explicitly supported Postgres < 9.6's `ssl_renegotiation` option. As of v3.3.0, it doesn't send `ssl_renegotiation: 0` either to support Redshift (https://github.com/jackc/pgx/pull/476). If you need TLS Renegotiation, consider supplying `ConnConfig.TLSConfig` with a non-zero `Renegotiation` value and if it's not the default on your server, set `ssl_renegotiation` via `ConnConfig.RuntimeParams`. pgx defines a simple logger interface. Connections optionally accept a logger that satisfies this interface. Set LogLevel to control logging verbosity. Adapters for github.com/inconshreveable/log15, github.com/sirupsen/logrus, and the testing log are provided in the log directory.

  • Homepage: https://github.com/Jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/Jackc/pgx#section-documentation
  • Licenses: MIT
  • Latest release: v3.6.2+incompatible (published over 6 years ago)
  • Last Synced: 2026-05-28T19:48:22.634Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 0.541%
    • Forks count: 0.741%
    • Average: 4.407%
    • Dependent packages count: 6.999%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/JACKC/pgx/v4

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/JACKC/pgx/v4#section-documentation
  • Licenses: mit
  • Latest release: v4.18.3 (published about 2 years ago)
  • Last Synced: 2026-05-28T19:48:25.969Z (2 days ago)
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 0.699%
    • Forks count: 0.996%
    • Average: 4.51%
    • Dependent packages count: 6.999%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/jackc/PGX

Package pgx is a PostgreSQL database driver. pgx provides lower level access to PostgreSQL than the standard database/sql. It remains as similar to the database/sql interface as possible while providing better speed and access to PostgreSQL specific features. Import github.com/jackc/pgx/stdlib to use pgx as a database/sql compatible driver. pgx implements Query and Scan in the familiar database/sql style. pgx also implements QueryRow in the same style as database/sql. Use Exec to execute a query that does not return a result set. Connection pool usage is explicit and configurable. In pgx, a connection can be created and managed directly, or a connection pool with a configurable maximum connections can be used. The connection pool offers an after connect hook that allows every connection to be automatically setup before being made available in the connection pool. It delegates methods such as QueryRow to an automatically checked out and released connection so you can avoid manually acquiring and releasing connections when you do not need that level of control. pgx maps between all common base types directly between Go and PostgreSQL. In particular: pgx can map nulls in two ways. The first is package pgtype provides types that have a data field and a status field. They work in a similar fashion to database/sql. The second is to use a pointer to a pointer. pgx maps between int16, int32, int64, float32, float64, and string Go slices and the equivalent PostgreSQL array type. Go slices of native types do not support nulls, so if a PostgreSQL array that contains a null is read into a native Go slice an error will occur. The pgtype package includes many more array types for PostgreSQL types that do not directly map to native Go types. pgx includes built-in support to marshal and unmarshal between Go types and the PostgreSQL JSON and JSONB. pgx encodes from net.IPNet to and from inet and cidr PostgreSQL types. In addition, as a convenience pgx will encode from a net.IP; it will assume a /32 netmask for IPv4 and a /128 for IPv6. pgx includes support for the common data types like integers, floats, strings, dates, and times that have direct mappings between Go and SQL. In addition, pgx uses the github.com/jackc/pgx/pgtype library to support more types. See documention for that library for instructions on how to implement custom types. See example_custom_type_test.go for an example of a custom type for the PostgreSQL point type. pgx also includes support for custom types implementing the database/sql.Scanner and database/sql/driver.Valuer interfaces. If pgx does cannot natively encode a type and that type is a renamed type (e.g. type MyTime time.Time) pgx will attempt to encode the underlying type. While this is usually desired behavior it can produce suprising behavior if one the underlying type and the renamed type each implement database/sql interfaces and the other implements pgx interfaces. It is recommended that this situation be avoided by implementing pgx interfaces on the renamed type. []byte passed as arguments to Query, QueryRow, and Exec are passed unmodified to PostgreSQL. Transactions are started by calling Begin or BeginEx. The BeginEx variant can create a transaction with a specified isolation level. Use CopyFrom to efficiently insert multiple rows at a time using the PostgreSQL copy protocol. CopyFrom accepts a CopyFromSource interface. If the data is already in a [][]interface{} use CopyFromRows to wrap it in a CopyFromSource interface. Or implement CopyFromSource to avoid buffering the entire data set in memory. CopyFrom can be faster than an insert with as few as 5 rows. pgx can listen to the PostgreSQL notification system with the WaitForNotification function. It takes a maximum time to wait for a notification. The pgx ConnConfig struct has a TLSConfig field. If this field is nil, then TLS will be disabled. If it is present, then it will be used to configure the TLS connection. This allows total configuration of the TLS connection. pgx has never explicitly supported Postgres < 9.6's `ssl_renegotiation` option. As of v3.3.0, it doesn't send `ssl_renegotiation: 0` either to support Redshift (https://github.com/jackc/pgx/pull/476). If you need TLS Renegotiation, consider supplying `ConnConfig.TLSConfig` with a non-zero `Renegotiation` value and if it's not the default on your server, set `ssl_renegotiation` via `ConnConfig.RuntimeParams`. pgx defines a simple logger interface. Connections optionally accept a logger that satisfies this interface. Set LogLevel to control logging verbosity. Adapters for github.com/inconshreveable/log15, github.com/sirupsen/logrus, and the testing log are provided in the log directory.

  • Homepage: https://github.com/jackc/PGX
  • Documentation: https://pkg.go.dev/github.com/jackc/PGX#section-documentation
  • Licenses: MIT
  • Latest release: v3.6.2+incompatible (published over 6 years ago)
  • Last Synced: 2026-05-28T19:48:20.407Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 0.71%
    • Forks count: 1.017%
    • Average: 4.518%
    • Dependent packages count: 6.999%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/jackc/pgx/v5/stdlib

Package stdlib is the compatibility layer from pgx to database/sql. A database/sql connection can be established through sql.Open. Or from a keyword/value string. Or from a *pgxpool.Pool. Or a pgx.ConnConfig can be used to set configuration not accessible via connection string. In this case the pgx.ConnConfig must first be registered with the driver. This registration returns a connection string which is used with sql.Open. pgx uses standard PostgreSQL positional parameters in queries. e.g. $1, $2. It does not support named parameters. (*sql.Conn) Raw() can be used to get a *pgx.Conn from the standard database/sql.DB connection pool. This allows operations that use pgx specific functionality. The pgtype package provides support for PostgreSQL specific types. *pgtype.Map.SQLScanner is an adapter that makes these types usable as a sql.Scanner.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/v5/stdlib#section-documentation
  • Licenses: MIT
  • Latest release: v5.9.2 (published 10 days ago)
  • Last Synced: 2026-05-28T19:48:24.540Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.73%
    • Average: 4.889%
    • Dependent repos count: 5.048%
proxy.golang.org: github.com/jackc/pgx/v5/pgconn/internal/ctxwatch

proxy.golang.org: github.com/jackc/pgx/v5/internal/anynil

proxy.golang.org: github.com/jackC/pgx/v5

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/jackC/pgx/v5#section-documentation
  • Licenses:
  • Latest release: v5.9.2 (published about 1 month ago)
  • Last Synced: 2026-05-28T19:48:14.586Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.751%
    • Average: 4.91%
    • Dependent repos count: 5.07%
proxy.golang.org: github.com/jackc/pgx/pgproto3

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/pgproto3#section-documentation
  • Licenses: MIT
  • Latest release: (published 9 days ago)
  • Last Synced: 2026-05-28T20:29:45.829Z (2 days ago)
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.779%
    • Average: 4.939%
    • Dependent repos count: 5.1%
proxy.golang.org: github.com/jackc/pgx/chunkreader

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/chunkreader#section-documentation
  • Licenses: MIT
  • Latest release: (published 9 days ago)
  • Last Synced: 2026-05-28T20:29:43.953Z (2 days ago)
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.779%
    • Average: 4.939%
    • Dependent repos count: 5.1%
proxy.golang.org: github.com/jackc/pgx/v5/pgconn/internal/bgreader

Package bgreader provides a io.Reader that can optionally buffer reads in the background.

proxy.golang.org: github.com/jackc/pgx/v5/pgconn/ctxwatch

proxy.golang.org: github.com/jackc/pgx/internal/sanitize

proxy.golang.org: github.com/jackc/pgx/v5/internal/pgio

Package pgio is a low-level toolkit building messages in the PostgreSQL wire protocol. pgio provides functions for appending integers to a []byte while doing byte order conversion.

proxy.golang.org: github.com/jackc/pgx/v5/pgtype

Package pgtype converts between Go and PostgreSQL values. The primary type is the Map type. It is a map of PostgreSQL types identified by OID (object ID) to a Codec. A Codec is responsible for converting between Go and PostgreSQL values. NewMap creates a Map with all supported standard PostgreSQL types already registered. Additional types can be registered with Map.RegisterType. Use Map.Scan and Map.Encode to decode PostgreSQL values to Go and encode Go values to PostgreSQL respectively. pgtype maps between all common base types directly between Go and PostgreSQL. In particular: pgtype can map NULLs in two ways. The first is types that can directly represent NULL such as Int4. They work in a similar fashion to database/sql. The second is to use a pointer to a pointer. When using nullable pgtype types as parameters for queries, one has to remember to explicitly set their Valid field to true, otherwise the parameter's value will be NULL. pgtype automatically marshals and unmarshals data from json and jsonb PostgreSQL types. Generally, all Codecs will support interfaces that can be implemented to enable scanning and encoding. For example, PointCodec can use any Go type that implements the PointScanner and PointValuer interfaces. So rather than use Point an application can directly use its own point type with pgtype as long as it implements those interfaces. See example_custom_type_test.go for an example of a custom type for the PostgreSQL point type. Sometimes pgx supports a PostgreSQL type such as numeric but the Go type is in an external package that does not have pgx support such as github.com/shopspring/decimal. These types can be registered with pgtype with custom conversion logic. See https://github.com/jackc/pgx-shopspring-decimal and https://github.com/jackc/pgx-gofrs-uuid for example integrations. pgtype uses the PostgreSQL OID to determine how to encode or decode a value. pgtype supports array, composite, domain, and enum types. However, any type created in PostgreSQL with CREATE TYPE will receive a new OID. This means that the OID of each new PostgreSQL type must be registered for pgtype to handle values of that type with the correct Codec. The github.com/jackc/pgx/v5.Conn.LoadType method can return a *Type for array, composite, domain, and enum types by inspecting the database metadata. This *Type can then be registered with Map.RegisterType. For example, the following function could be called after a connection is established: A type cannot be registered unless all types it depends on are already registered. e.g. An array type cannot be registered until its element type is registered. ArrayCodec implements support for arrays. If pgtype supports type T then it can easily support []T by registering an ArrayCodec for the appropriate PostgreSQL OID. In addition, Array type can support multi-dimensional arrays. CompositeCodec implements support for PostgreSQL composite types. Go structs can be scanned into if the public fields of the struct are in the exact order and type of the PostgreSQL type or by implementing CompositeIndexScanner and CompositeIndexGetter. Domain types are treated as their underlying type if the underlying type and the domain type are registered. PostgreSQL enums can usually be treated as text. However, EnumCodec implements support for interning strings which can reduce memory usage. While pgtype will often still work with unregistered types it is highly recommended that all types be registered due to an improvement in performance and the elimination of certain edge cases. If an entirely new PostgreSQL type (e.g. PostGIS types) is used then the application or a library can create a new Codec. Then the OID / Codec mapping can be registered with Map.RegisterType. There is no difference between a Codec defined and registered by the application and a Codec built in to pgtype. See any of the [Codec]s in pgtype for Codec examples and for examples of type registration. pgtype works best when the OID of the PostgreSQL type is known. But in some cases such as using the simple protocol the OID is unknown. In this case Map.RegisterDefaultPgType can be used to register an assumed OID for a particular Go type. If pgtype does not recognize a type and that type is a renamed simple type simple (e.g. type MyInt32 int32) pgtype acts as if it is the underlying type. It currently cannot automatically detect the underlying type of renamed structs (eg.g. type MyTime time.Time). Compatibility with database/sql pgtype also includes support for custom types implementing the database/sql.Scanner and database/sql/driver.Valuer interfaces. pgtype encodes untyped and typed nils (e.g. nil and []byte(nil)) to the SQL NULL value without going through the Codec system. This means that [Codec]s and other encoding logic do not have to handle nil or *T(nil). However, database/sql compatibility requires Value to be called on T(nil) when T implements database/sql/driver.Valuer. Therefore, database/sql/driver.Valuer values are only considered NULL when *T(nil) where database/sql/driver.Valuer is implemented on T not on *T. See https://github.com/golang/go/issues/8415 and https://github.com/golang/go/commit/0ce1d79a6a771f7449ec493b993ed2a720917870. pgtype's support for arrays and composite records can be used to load records and their children in a single query. See example_child_records_test.go for an example. The first step is to use the OID to lookup the correct Codec. The Map will call the [Codec.PlanScan] method to get a plan for scanning into the Go value. A Codec will support scanning into one or more Go types. Oftentime these Go types are interfaces rather than explicit types. For example, PointCodec can use any Go type that implements the PointScanner and PointValuer interfaces. If a Go value is not supported directly by a Codec then Map will try see if it is a database/sql.Scanner. If is then that interface will be used to scan the value. Most [database/sql.Scanner]s require the input to be in the text format (e.g. UUIDs and numeric). However, pgx will typically have received the value in the binary format. In this case the binary value will be parsed, reencoded as text, and then passed to the database/sql.Scanner. This may incur additional overhead for query results with a large number of affected values. If a Go value is not supported directly by a Codec then Map will try wrapping it with additional logic and try again. For example, Int8Codec does not support scanning into a renamed type (e.g. type myInt64 int64). But Map will detect that myInt64 is a renamed type and create a plan that converts the value to the underlying int64 type and then passes that to the Codec (see TryFindUnderlyingTypeScanPlan). These plan wrappers are contained in [Map.TryWrapScanPlanFuncs]. By default these contain shared logic to handle renamed types, pointers to pointers, slices, composite types, etc. Additional plan wrappers can be added to seamlessly integrate types that do not support pgx directly. For example, the before mentioned https://github.com/jackc/pgx-shopspring-decimal package detects decimal.Decimal values, wraps them in something implementing NumericScanner and passes that to the Codec. Map.Scan and Map.Encode are convenience methods that wrap Map.PlanScan and Map.PlanEncode. Determining how to scan or encode a particular type may be a time consuming operation. Hence the planning and execution steps of a conversion are internally separated. github.com/jackc/pgx/v5.QueryExecModeExec and github.com/jackc/pgx/v5.QueryExecModeSimpleProtocol require the default PostgreSQL type to be registered for each Go type used as a query parameter. By default pgx does this for all supported types and their array variants. If an application does not use those query execution modes or manually registers the default PostgreSQL type for the types it uses as query parameters it can use the build tag nopgxregisterdefaulttypes. This omits the default type registration and reduces the compiled binary size by ~2MB. This example uses a single query to return parent and child records.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/v5/pgtype#section-documentation
  • Licenses: MIT
  • Latest release: v5.9.2 (published 25 days ago)
  • Last Synced: 2026-05-28T20:29:43.850Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.779%
    • Average: 4.939%
    • Dependent repos count: 5.1%
proxy.golang.org: github.com/jackc/pgx/v5/internal/stmtcache

Package stmtcache is a cache for statement descriptions.

proxy.golang.org: github.com/jackc/pgx/v5/internal/iobufpool

Package iobufpool implements a global segregated-fit pool of buffers for IO. It uses *[]byte instead of []byte to avoid the sync.Pool allocation with Put. Unfortunately, using a pointer to avoid an allocation is purposely not documented. https://github.com/golang/go/issues/16323

proxy.golang.org: github.com/jackc/pgx/v5/pgxpool

Package pgxpool is a concurrency-safe connection pool for pgx. pgxpool implements a nearly identical interface to pgx connections. The primary way of creating a pool is with pgxpool.New: The database connection string can be in URL or keyword/value format. PostgreSQL settings, pgx settings, and pool settings can be specified here. In addition, a config struct can be created by ParseConfig. A pool returns without waiting for any connections to be established. Acquire a connection immediately after creating the pool to check if a connection can successfully be established.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/v5/pgxpool#section-documentation
  • Licenses: MIT
  • Latest release: v5.9.2 (published 25 days ago)
  • Last Synced: 2026-05-28T20:29:44.106Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.779%
    • Average: 4.939%
    • Dependent repos count: 5.1%
proxy.golang.org: github.com/jackc/pgx/pgtype

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/pgtype#section-documentation
  • Licenses: MIT
  • Latest release: (published 10 days ago)
  • Last Synced: 2026-05-28T20:29:45.408Z (2 days ago)
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.779%
    • Average: 4.939%
    • Dependent repos count: 5.1%
proxy.golang.org: github.com/jackc/pgx/v5/internal/sanitize

proxy.golang.org: github.com/jackc/pgx/pgio

Package pgio is a low-level toolkit building messages in the PostgreSQL wire protocol. pgio provides functions for appending integers to a []byte while doing byte order conversion.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/pgio#section-documentation
  • Licenses: MIT
  • Latest release: (published 10 days ago)
  • Last Synced: 2026-05-28T20:29:44.345Z (2 days ago)
  • Versions: 10
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.779%
    • Average: 4.939%
    • Dependent repos count: 5.1%
proxy.golang.org: github.com/jackc/pgx/v5/pgconn

Package pgconn is a low-level PostgreSQL database driver. pgconn provides lower level access to a PostgreSQL connection than a database/sql or pgx connection. It operates at nearly the same level is the C library libpq. Use Connect to establish a connection. It accepts a connection string in URL or keyword/value format and will read the environment for libpq style environment variables. ExecParams and ExecPrepared execute a single query. They return readers that iterate over each row. The Read method reads all rows into memory. Exec and ExecBatch can execute multiple queries in a single round trip. They return readers that iterate over each query result. The ReadAll method reads all query results into memory. Pipeline mode allows sending queries without having read the results of previously sent queries. It allows control of exactly how many and when network round trips occur. All potentially blocking operations take a context.Context. The default behavior when a context is canceled is for the method to immediately return. In most circumstances, this will also close the underlying connection. This behavior can be customized by using BuildContextWatcherHandler on the Config to create a ctxwatch.Handler with different behavior. This can be especially useful when queries that are frequently canceled and the overhead of creating new connections is a problem. DeadlineContextWatcherHandler and CancelRequestContextWatcherHandler can be used to introduce a delay before interrupting the query in such a way as to close the connection. The CancelRequest method may be used to request the PostgreSQL server cancel an in-progress query without forcing the client to abort.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/v5/pgconn#section-documentation
  • Licenses: MIT
  • Latest release: v5.9.2 (published 25 days ago)
  • Last Synced: 2026-05-28T20:29:43.849Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 4.779%
    • Average: 4.939%
    • Dependent repos count: 5.1%
proxy.golang.org: github.com/jacKc/pgx/v4

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/jacKc/pgx/v4#section-documentation
  • Licenses: mit
  • Latest release: v4.18.3 (published about 2 years ago)
  • Last Synced: 2026-05-28T20:29:46.520Z (2 days ago)
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 0.742%
    • Forks count: 1.073%
    • Average: 5.165%
    • Dependent packages count: 8.453%
    • Dependent repos count: 10.392%
proxy.golang.org: github.com/jacKc/pgx

Package pgx is a PostgreSQL database driver.

  • Homepage: https://github.com/jacKc/pgx
  • Documentation: https://pkg.go.dev/github.com/jacKc/pgx#section-documentation
  • Licenses: MIT
  • Latest release: v3.6.2+incompatible (published over 6 years ago)
  • Last Synced: 2026-05-28T19:48:07.016Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Stargazers count: 0.742%
    • Forks count: 1.073%
    • Average: 5.165%
    • Dependent packages count: 8.453%
    • Dependent repos count: 10.392%
proxy.golang.org: github.com/jackc/pgX

Package pgx is a PostgreSQL database driver.

  • Homepage: https://github.com/jackc/pgX
  • Documentation: https://pkg.go.dev/github.com/jackc/pgX#section-documentation
  • Licenses: MIT
  • Latest release: v3.6.2+incompatible (published over 6 years ago)
  • Last Synced: 2026-05-28T19:48:07.636Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 5.796%
    • Average: 5.99%
    • Dependent repos count: 6.184%
proxy.golang.org: github.com/jackc/pgx/v4/stdlib

Package stdlib is the compatibility layer from pgx to database/sql. A database/sql connection can be established through sql.Open. Or from a DSN string. Or a pgx.ConnConfig can be used to set configuration not accessible via connection string. In this case the pgx.ConnConfig must first be registered with the driver. This registration returns a connection string which is used with sql.Open. pgx uses standard PostgreSQL positional parameters in queries. e.g. $1, $2. It does not support named parameters. In Go 1.13 and above (*sql.Conn) Raw() can be used to get a *pgx.Conn from the standard database/sql.DB connection pool. This allows operations that use pgx specific functionality.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/v4/stdlib#section-documentation
  • Licenses: MIT
  • Latest release: v4.18.3 (published 3 months ago)
  • Last Synced: 2026-05-28T20:29:45.678Z (2 days ago)
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 5.923%
    • Average: 6.121%
    • Dependent repos count: 6.319%
proxy.golang.org: github.com/jackc/pgx/v4/log/zapadapter

Package zapadapter provides a logger that writes to a go.uber.org/zap.Logger.

proxy.golang.org: github.com/jackc/pgx/v4/pgxpool

Package pgxpool is a concurrency-safe connection pool for pgx. pgxpool implements a nearly identical interface to pgx connections. The primary way of establishing a connection is with `pgxpool.Connect`. 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`.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/pgx/v4/pgxpool#section-documentation
  • Licenses: MIT
  • Latest release: v4.18.3 (published 3 months ago)
  • Last Synced: 2026-05-28T19:48:07.962Z (2 days ago)
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.151%
    • Average: 6.357%
    • Dependent repos count: 6.563%
proxy.golang.org: github.com/jackc/pgx/v4/internal/sanitize

proxy.golang.org: github.com/jackc/Pgx/v5

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/jackc/Pgx/v5#section-documentation
  • Licenses: mit
  • Latest release: v5.9.2 (published about 1 month ago)
  • Last Synced: 2026-05-28T19:48:22.626Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.488%
    • Average: 6.707%
    • Dependent repos count: 6.926%
proxy.golang.org: github.com/jackc/Pgx

Package pgx is a PostgreSQL database driver. pgx provides lower level access to PostgreSQL than the standard database/sql. It remains as similar to the database/sql interface as possible while providing better speed and access to PostgreSQL specific features. Import github.com/jackc/pgx/stdlib to use pgx as a database/sql compatible driver. pgx implements Query and Scan in the familiar database/sql style. pgx also implements QueryRow in the same style as database/sql. Use Exec to execute a query that does not return a result set. Connection pool usage is explicit and configurable. In pgx, a connection can be created and managed directly, or a connection pool with a configurable maximum connections can be used. The connection pool offers an after connect hook that allows every connection to be automatically setup before being made available in the connection pool. It delegates methods such as QueryRow to an automatically checked out and released connection so you can avoid manually acquiring and releasing connections when you do not need that level of control. pgx maps between all common base types directly between Go and PostgreSQL. In particular: pgx can map nulls in two ways. The first is package pgtype provides types that have a data field and a status field. They work in a similar fashion to database/sql. The second is to use a pointer to a pointer. pgx maps between int16, int32, int64, float32, float64, and string Go slices and the equivalent PostgreSQL array type. Go slices of native types do not support nulls, so if a PostgreSQL array that contains a null is read into a native Go slice an error will occur. The pgtype package includes many more array types for PostgreSQL types that do not directly map to native Go types. pgx includes built-in support to marshal and unmarshal between Go types and the PostgreSQL JSON and JSONB. pgx encodes from net.IPNet to and from inet and cidr PostgreSQL types. In addition, as a convenience pgx will encode from a net.IP; it will assume a /32 netmask for IPv4 and a /128 for IPv6. pgx includes support for the common data types like integers, floats, strings, dates, and times that have direct mappings between Go and SQL. In addition, pgx uses the github.com/jackc/pgx/pgtype library to support more types. See documention for that library for instructions on how to implement custom types. See example_custom_type_test.go for an example of a custom type for the PostgreSQL point type. pgx also includes support for custom types implementing the database/sql.Scanner and database/sql/driver.Valuer interfaces. If pgx does cannot natively encode a type and that type is a renamed type (e.g. type MyTime time.Time) pgx will attempt to encode the underlying type. While this is usually desired behavior it can produce suprising behavior if one the underlying type and the renamed type each implement database/sql interfaces and the other implements pgx interfaces. It is recommended that this situation be avoided by implementing pgx interfaces on the renamed type. []byte passed as arguments to Query, QueryRow, and Exec are passed unmodified to PostgreSQL. Transactions are started by calling Begin or BeginEx. The BeginEx variant can create a transaction with a specified isolation level. Use CopyFrom to efficiently insert multiple rows at a time using the PostgreSQL copy protocol. CopyFrom accepts a CopyFromSource interface. If the data is already in a [][]interface{} use CopyFromRows to wrap it in a CopyFromSource interface. Or implement CopyFromSource to avoid buffering the entire data set in memory. CopyFrom can be faster than an insert with as few as 5 rows. pgx can listen to the PostgreSQL notification system with the WaitForNotification function. It takes a maximum time to wait for a notification. The pgx ConnConfig struct has a TLSConfig field. If this field is nil, then TLS will be disabled. If it is present, then it will be used to configure the TLS connection. This allows total configuration of the TLS connection. pgx has never explicitly supported Postgres < 9.6's `ssl_renegotiation` option. As of v3.3.0, it doesn't send `ssl_renegotiation: 0` either to support Redshift (https://github.com/jackc/pgx/pull/476). If you need TLS Renegotiation, consider supplying `ConnConfig.TLSConfig` with a non-zero `Renegotiation` value and if it's not the default on your server, set `ssl_renegotiation` via `ConnConfig.RuntimeParams`. pgx defines a simple logger interface. Connections optionally accept a logger that satisfies this interface. Set LogLevel to control logging verbosity. Adapters for github.com/inconshreveable/log15, github.com/sirupsen/logrus, and the testing log are provided in the log directory.

  • Homepage: https://github.com/jackc/Pgx
  • Documentation: https://pkg.go.dev/github.com/jackc/Pgx#section-documentation
  • Licenses: MIT
  • Latest release: v3.6.2+incompatible (published over 6 years ago)
  • Last Synced: 2026-05-28T19:48:17.368Z (2 days ago)
  • Versions: 24
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.488%
    • Average: 6.707%
    • Dependent repos count: 6.926%
proxy.golang.org: github.com/JackC/pgx/v4

Package pgx is a PostgreSQL database driver. pgx provides lower level access to PostgreSQL than the standard database/sql. It remains as similar to the database/sql interface as possible while providing better speed and access to PostgreSQL specific features. Import github.com/jackc/pgx/v4/stdlib to use pgx as a database/sql compatible driver. The primary way of establishing a connection is with `pgx.Connect`. The database connection string can be in URL or DSN format. Both PostgreSQL settings and pgx settings can be specified here. In addition, a config struct can be created by `ParseConfig` and modified before establishing the connection with `ConnectConfig`. `*pgx.Conn` represents a single connection to the database and is not concurrency safe. Use sub-package pgxpool for a concurrency safe connection pool. pgx implements Query and Scan in the familiar database/sql style. pgx also implements QueryRow in the same style as database/sql. Use Exec to execute a query that does not return a result set. QueryFunc can be used to execute a callback function for every row. This is often easier to use than Query. pgx maps between all common base types directly between Go and PostgreSQL. In particular: pgx can map nulls in two ways. The first is package pgtype provides types that have a data field and a status field. They work in a similar fashion to database/sql. The second is to use a pointer to a pointer. pgx maps between int16, int32, int64, float32, float64, and string Go slices and the equivalent PostgreSQL array type. Go slices of native types do not support nulls, so if a PostgreSQL array that contains a null is read into a native Go slice an error will occur. The pgtype package includes many more array types for PostgreSQL types that do not directly map to native Go types. pgx includes built-in support to marshal and unmarshal between Go types and the PostgreSQL JSON and JSONB. pgx encodes from net.IPNet to and from inet and cidr PostgreSQL types. In addition, as a convenience pgx will encode from a net.IP; it will assume a /32 netmask for IPv4 and a /128 for IPv6. pgx includes support for the common data types like integers, floats, strings, dates, and times that have direct mappings between Go and SQL. In addition, pgx uses the github.com/jackc/pgtype library to support more types. See documention for that library for instructions on how to implement custom types. See example_custom_type_test.go for an example of a custom type for the PostgreSQL point type. pgx also includes support for custom types implementing the database/sql.Scanner and database/sql/driver.Valuer interfaces. If pgx does cannot natively encode a type and that type is a renamed type (e.g. type MyTime time.Time) pgx will attempt to encode the underlying type. While this is usually desired behavior it can produce surprising behavior if one the underlying type and the renamed type each implement database/sql interfaces and the other implements pgx interfaces. It is recommended that this situation be avoided by implementing pgx interfaces on the renamed type. Row values and composite types are represented as pgtype.Record (https://pkg.go.dev/github.com/jackc/pgtype?tab=doc#Record). It is possible to get values of your custom type by implementing DecodeBinary interface. Decoding into pgtype.Record first can simplify process by avoiding dealing with raw protocol directly. For example: []byte passed as arguments to Query, QueryRow, and Exec are passed unmodified to PostgreSQL. Transactions are started by calling Begin. The Tx returned from Begin also implements the Begin method. This can be used to implement pseudo nested transactions. These are internally implemented with savepoints. Use BeginTx to control the transaction mode. BeginFunc and BeginTxFunc are variants that begin a transaction, execute a function, and commit or rollback the transaction depending on the return value of the function. These can be simpler and less error prone to use. Prepared statements can be manually created with the Prepare method. However, this is rarely necessary because pgx includes an automatic statement cache by default. Queries run through the normal Query, QueryRow, and Exec functions are automatically prepared on first execution and the prepared statement is reused on subsequent executions. See ParseConfig for information on how to customize or disable the statement cache. Use CopyFrom to efficiently insert multiple rows at a time using the PostgreSQL copy protocol. CopyFrom accepts a CopyFromSource interface. If the data is already in a [][]interface{} use CopyFromRows to wrap it in a CopyFromSource interface. Or implement CopyFromSource to avoid buffering the entire data set in memory. When you already have a typed array using CopyFromSlice can be more convenient. CopyFrom can be faster than an insert with as few as 5 rows. pgx can listen to the PostgreSQL notification system with the `Conn.WaitForNotification` method. It blocks until a notification is received or the context is canceled. pgx defines a simple logger interface. Connections optionally accept a logger that satisfies this interface. Set LogLevel to control logging verbosity. Adapters for github.com/inconshreveable/log15, github.com/sirupsen/logrus, go.uber.org/zap, github.com/rs/zerolog, and the testing log are provided in the log directory. pgx is implemented on top of github.com/jackc/pgconn a lower level PostgreSQL driver. The Conn.PgConn() method can be used to access this lower layer. pgx is compatible with PgBouncer in two modes. One is when the connection has a statement cache in "describe" mode. The other is when the connection is using the simple protocol. This can be set with the PreferSimpleProtocol config option.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/JackC/pgx/v4#section-documentation
  • Licenses: MIT
  • Latest release: v4.18.3 (published about 2 years ago)
  • Last Synced: 2026-05-28T19:48:32.445Z (2 days ago)
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.999%
    • Average: 8.173%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/JackC/pgx/v5

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/JackC/pgx/v5#section-documentation
  • Licenses: mit
  • Latest release: v5.9.2 (published about 1 month ago)
  • Last Synced: 2026-05-28T19:48:36.005Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.999%
    • Average: 8.173%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/Jackc/pgx/v4

Package pgx is a PostgreSQL database driver. pgx provides lower level access to PostgreSQL than the standard database/sql. It remains as similar to the database/sql interface as possible while providing better speed and access to PostgreSQL specific features. Import github.com/jackc/pgx/v4/stdlib to use pgx as a database/sql compatible driver. The primary way of establishing a connection is with `pgx.Connect`. The database connection string can be in URL or DSN format. Both PostgreSQL settings and pgx settings can be specified here. In addition, a config struct can be created by `ParseConfig` and modified before establishing the connection with `ConnectConfig`. `*pgx.Conn` represents a single connection to the database and is not concurrency safe. Use sub-package pgxpool for a concurrency safe connection pool. pgx implements Query and Scan in the familiar database/sql style. pgx also implements QueryRow in the same style as database/sql. Use Exec to execute a query that does not return a result set. QueryFunc can be used to execute a callback function for every row. This is often easier to use than Query. pgx maps between all common base types directly between Go and PostgreSQL. In particular: pgx can map nulls in two ways. The first is package pgtype provides types that have a data field and a status field. They work in a similar fashion to database/sql. The second is to use a pointer to a pointer. pgx maps between int16, int32, int64, float32, float64, and string Go slices and the equivalent PostgreSQL array type. Go slices of native types do not support nulls, so if a PostgreSQL array that contains a null is read into a native Go slice an error will occur. The pgtype package includes many more array types for PostgreSQL types that do not directly map to native Go types. pgx includes built-in support to marshal and unmarshal between Go types and the PostgreSQL JSON and JSONB. pgx encodes from net.IPNet to and from inet and cidr PostgreSQL types. In addition, as a convenience pgx will encode from a net.IP; it will assume a /32 netmask for IPv4 and a /128 for IPv6. pgx includes support for the common data types like integers, floats, strings, dates, and times that have direct mappings between Go and SQL. In addition, pgx uses the github.com/jackc/pgtype library to support more types. See documention for that library for instructions on how to implement custom types. See example_custom_type_test.go for an example of a custom type for the PostgreSQL point type. pgx also includes support for custom types implementing the database/sql.Scanner and database/sql/driver.Valuer interfaces. If pgx does cannot natively encode a type and that type is a renamed type (e.g. type MyTime time.Time) pgx will attempt to encode the underlying type. While this is usually desired behavior it can produce surprising behavior if one the underlying type and the renamed type each implement database/sql interfaces and the other implements pgx interfaces. It is recommended that this situation be avoided by implementing pgx interfaces on the renamed type. Row values and composite types are represented as pgtype.Record (https://pkg.go.dev/github.com/jackc/pgtype?tab=doc#Record). It is possible to get values of your custom type by implementing DecodeBinary interface. Decoding into pgtype.Record first can simplify process by avoiding dealing with raw protocol directly. For example: []byte passed as arguments to Query, QueryRow, and Exec are passed unmodified to PostgreSQL. Transactions are started by calling Begin. The Tx returned from Begin also implements the Begin method. This can be used to implement pseudo nested transactions. These are internally implemented with savepoints. Use BeginTx to control the transaction mode. BeginFunc and BeginTxFunc are variants that begin a transaction, execute a function, and commit or rollback the transaction depending on the return value of the function. These can be simpler and less error prone to use. Prepared statements can be manually created with the Prepare method. However, this is rarely necessary because pgx includes an automatic statement cache by default. Queries run through the normal Query, QueryRow, and Exec functions are automatically prepared on first execution and the prepared statement is reused on subsequent executions. See ParseConfig for information on how to customize or disable the statement cache. Use CopyFrom to efficiently insert multiple rows at a time using the PostgreSQL copy protocol. CopyFrom accepts a CopyFromSource interface. If the data is already in a [][]interface{} use CopyFromRows to wrap it in a CopyFromSource interface. Or implement CopyFromSource to avoid buffering the entire data set in memory. When you already have a typed array using CopyFromSlice can be more convenient. CopyFrom can be faster than an insert with as few as 5 rows. pgx can listen to the PostgreSQL notification system with the `Conn.WaitForNotification` method. It blocks until a notification is received or the context is canceled. pgx defines a simple logger interface. Connections optionally accept a logger that satisfies this interface. Set LogLevel to control logging verbosity. Adapters for github.com/inconshreveable/log15, github.com/sirupsen/logrus, go.uber.org/zap, github.com/rs/zerolog, and the testing log are provided in the log directory. pgx is implemented on top of github.com/jackc/pgconn a lower level PostgreSQL driver. The Conn.PgConn() method can be used to access this lower layer. pgx is compatible with PgBouncer in two modes. One is when the connection has a statement cache in "describe" mode. The other is when the connection is using the simple protocol. This can be set with the PreferSimpleProtocol config option.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/Jackc/pgx/v4#section-documentation
  • Licenses: MIT
  • Latest release: v4.18.3 (published about 2 years ago)
  • Last Synced: 2026-05-28T19:48:12.387Z (2 days ago)
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.999%
    • Average: 8.173%
    • Dependent repos count: 9.346%
proxy.golang.org: gopkg.in/jackc/pgx.v1

Package pgx is a PostgreSQL database driver. It does not implement the standard database/sql interface.

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/gopkg.in/jackc/pgx.v1#section-documentation
  • Licenses: MIT
  • Latest release: (published 10 days ago)
  • Last Synced: 2026-05-28T20:29:53.635Z (2 days ago)
  • Versions: 0
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.999%
    • Average: 8.173%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/jackc/PGX/v4

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/jackc/PGX/v4#section-documentation
  • Licenses: mit
  • Latest release: v4.18.3 (published about 2 years ago)
  • Last Synced: 2026-05-28T20:29:46.232Z (2 days ago)
  • Versions: 41
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 6.999%
    • Average: 8.173%
    • Dependent repos count: 9.346%
proxy.golang.org: github.com/Jackc/pgx/v5

Package pgx is a PostgreSQL database driver. pgx provides a native PostgreSQL driver and can act as a database/sql/driver. The native PostgreSQL interface is similar to the database/sql interface while providing better speed and access to PostgreSQL specific features. Use github.com/jackc/pgx/v5/stdlib to use pgx as a database/sql compatible driver. See that package's documentation for details. The primary way of establishing a connection is with pgx.Connect: The database connection string can be in URL or key/value format. Both PostgreSQL settings and pgx settings can be specified here. In addition, a config struct can be created by ParseConfig and modified before establishing the connection with ConnectConfig to configure settings such as tracing that cannot be configured with a connection string. *pgx.Conn represents a single connection to the database and is not concurrency safe. Use package github.com/jackc/pgx/v5/pgxpool for a concurrency safe connection pool. pgx implements Conn.Query in the familiar database/sql style. However, pgx provides generic functions such as CollectRows and ForEachRow that are a simpler and safer way of processing rows than manually calling defer [Rows.Close], [Rows.Next], [Rows.Scan], and [Rows.Err]. CollectRows can be used collect all returned rows into a slice. ForEachRow can be used to execute a callback function for every row. This is often easier than iterating over rows directly. pgx also implements Conn.QueryRow in the same style as database/sql. Use Conn.Exec to execute a query that does not return a result set. pgx uses the pgtype package to converting Go values to and from PostgreSQL values. It supports many PostgreSQL types directly and is customizable and extendable. User defined data types such as enums, domains, and composite types may require type registration. See that package's documentation for details. Transactions are started by calling Conn.Begin. The Tx returned from Conn.Begin also implements the [Tx.Begin] method. This can be used to implement pseudo nested transactions. These are internally implemented with savepoints. Use Conn.BeginTx to control the transaction mode. Conn.BeginTx also can be used to ensure a new transaction is created instead of a pseudo nested transaction. BeginFunc and BeginTxFunc are functions that begin a transaction, execute a function, and commit or rollback the transaction depending on the return value of the function. These can be simpler and less error prone to use. Prepared statements can be manually created with the Conn.Prepare method. However, this is rarely necessary because pgx includes an automatic statement cache by default. Queries run through the normal Conn.Query, Conn.QueryRow, and Conn.Exec functions are automatically prepared on first execution and the prepared statement is reused on subsequent executions. See ParseConfig for information on how to customize or disable the statement cache. Use Conn.CopyFrom to efficiently insert multiple rows at a time using the PostgreSQL copy protocol. Conn.CopyFrom accepts a CopyFromSource interface. If the data is already in a [][]any use CopyFromRows to wrap it in a CopyFromSource interface. Or implement CopyFromSource to avoid buffering the entire data set in memory. When you already have a typed array using CopyFromSlice can be more convenient. CopyFrom can be faster than an insert with as few as 5 rows. pgx can listen to the PostgreSQL notification system with the Conn.WaitForNotification method. It blocks until a notification is received or the context is canceled. pgx supports tracing by setting [ConnConfig.Tracer]. To combine several tracers you can use the github.com/jackc/pgx/v5/multitracer.Tracer. In addition, the github.com/jackc/pgx/v5/tracelog package provides the github.com/jackc/pgx/v5/tracelog.TraceLog type which lets a traditional logger act as a QueryTracer. For debug tracing of the actual PostgreSQL wire protocol messages see github.com/jackc/pgx/v5/pgproto3. github.com/jackc/pgx/v5/pgconn contains a lower level PostgreSQL driver roughly at the level of libpq. Conn is implemented on top of pgconn.PgConn. The Conn.PgConn method can be used to access this lower layer. By default pgx automatically uses prepared statements. Prepared statements are incompatible with PgBouncer. This can be disabled by setting a different QueryExecMode in [ConnConfig.DefaultQueryExecMode].

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://pkg.go.dev/github.com/Jackc/pgx/v5#section-documentation
  • Licenses: MIT
  • Latest release: v5.9.2 (published about 1 month ago)
  • Last Synced: 2026-05-28T19:48:19.984Z (2 days ago)
  • Versions: 42
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent packages count: 7.982%
    • Average: 8.664%
    • Dependent repos count: 9.345%
ubuntu-22.04: golang-github-jackc-pgx

  • Homepage: https://github.com/jackc/pgx
  • Licenses:
  • Latest release: 3.6.2-2 (published 4 months ago)
  • Last Synced: 2026-03-07T03:37:03.153Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-12: golang-github-jackc-pgx

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://packages.debian.org/bookworm/golang-github-jackc-pgx
  • Licenses:
  • Latest release: 4.15.0-4 (published 4 months ago)
  • Last Synced: 2026-03-12T20:13:27.016Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
guix: go-github-com-jackc-pgx-v5

PostgreSQL driver and toolkit for Golang

guix: go-github-com-jackc-pgx-v4

PostgreSQL driver and toolkit for Golang

debian-11: golang-github-jackc-pgx

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://packages.debian.org/bullseye/golang-github-jackc-pgx
  • Licenses: mit
  • Latest release: 3.6.2-2 (published 4 months ago)
  • Last Synced: 2026-03-13T14:35:00.900Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.10: golang-github-jackc-pgx

  • Homepage: https://github.com/jackc/pgx
  • Licenses: mit
  • Latest release: 4.15.0-4 (published 4 months ago)
  • Last Synced: 2026-03-13T17:20:29.811Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
debian-13: golang-github-jackc-pgx

  • Homepage: https://github.com/jackc/pgx
  • Documentation: https://packages.debian.org/trixie/golang-github-jackc-pgx
  • Licenses:
  • Latest release: 4.18.1-2 (published 4 months ago)
  • Last Synced: 2026-03-13T19:14:47.739Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-23.04: golang-github-jackc-pgx

  • Homepage: https://github.com/jackc/pgx
  • Licenses: mit
  • Latest release: 4.15.0-4 (published 4 months ago)
  • Last Synced: 2026-03-11T09:04:40.551Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
guix: go-github-com-jackc-pgx

PostgreSQL driver and toolkit for Golang

ubuntu-24.10: golang-github-jackc-pgx

  • Homepage: https://github.com/jackc/pgx
  • Licenses:
  • Latest release: 4.18.1-1 (published 4 months ago)
  • Last Synced: 2026-03-08T15:45:19.377Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%
ubuntu-24.04: golang-github-jackc-pgx

  • Homepage: https://github.com/jackc/pgx
  • Licenses:
  • Latest release: 4.18.1-1 (published 4 months ago)
  • Last Synced: 2026-03-05T17:10:29.227Z (3 months ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v3 composite
  • actions/setup-go v3 composite
go.mod go
  • github.com/davecgh/go-spew v1.1.1
  • github.com/jackc/pgpassfile v1.0.0
  • github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a
  • github.com/jackc/puddle/v2 v2.1.2
  • github.com/kr/pretty v0.3.0
  • github.com/pmezard/go-difflib v1.0.0
  • github.com/stretchr/testify v1.8.0
  • go.uber.org/atomic v1.10.0
  • golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
  • golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7
  • golang.org/x/text v0.3.8
  • gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
  • gopkg.in/yaml.v3 v3.0.1
go.sum go
  • github.com/creack/pty v1.1.9
  • github.com/davecgh/go-spew v1.1.0
  • github.com/davecgh/go-spew v1.1.1
  • github.com/jackc/pgpassfile v1.0.0
  • github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a
  • github.com/jackc/puddle/v2 v2.1.2
  • github.com/kr/pretty v0.1.0
  • github.com/kr/pretty v0.2.1
  • github.com/kr/pretty v0.3.0
  • github.com/kr/pty v1.1.1
  • github.com/kr/text v0.1.0
  • github.com/kr/text v0.2.0
  • github.com/pmezard/go-difflib v1.0.0
  • github.com/rogpeppe/go-internal v1.6.1
  • github.com/stretchr/objx v0.1.0
  • github.com/stretchr/objx v0.4.0
  • github.com/stretchr/testify v1.3.0
  • github.com/stretchr/testify v1.7.0
  • github.com/stretchr/testify v1.7.1
  • github.com/stretchr/testify v1.8.0
  • go.uber.org/atomic v1.10.0
  • golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90
  • golang.org/x/sync v0.0.0-20220923202941-7f9b1623fab7
  • golang.org/x/text v0.3.8
  • gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
  • gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
  • gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
  • gopkg.in/errgo.v2 v2.1.0
  • gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
  • gopkg.in/yaml.v3 v3.0.1