Ecosyste.ms: Repos

An open API service providing repository metadata for many open source software ecosystems.

Package Usage: go: 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.
39 versions
Latest release: about 1 year ago
8,017 dependent packages

View more package details: https://packages.ecosyste.ms/registries/proxy.golang.org/packages/github.com/jackc/pgx/v4

View more repository details: https://repos.ecosyste.ms/hosts/GitHub/repositories/jackc%2Fpgx

Dependent Repos 18,275

ossf/scorecard-action
Official GitHub Action for OpenSSF Scorecard.
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.6.0 go.sum
  • v4.12.1-0.20210724153913-640aa07df17c go.sum
  • v4.15.0 go.sum

Size: 6.39 MB - Last synced: 4 days ago - Pushed: 4 days ago

xav-b/crypto-stuff
Tinkering around
  • v4.13.0 streaming-ethereum-on-chain-data-to-questdb/go.mod
  • v4.0.0-20190420224344-cc3461e65d96 streaming-ethereum-on-chain-data-to-questdb/go.sum
  • v4.0.0-20190421002000-1b8f0016e912 streaming-ethereum-on-chain-data-to-questdb/go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 streaming-ethereum-on-chain-data-to-questdb/go.sum
  • v4.12.1-0.20210724153913-640aa07df17c streaming-ethereum-on-chain-data-to-questdb/go.sum
  • v4.13.0 streaming-ethereum-on-chain-data-to-questdb/go.sum

Size: 7.6 MB - Last synced: about 1 year ago - Pushed: over 1 year ago

msrinivasssa/go-trial-app
  • v4.14.0 go.mod
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.12.1-0.20210724153913-640aa07df17c go.sum
  • v4.14.0 go.sum

Size: 397 KB - Last synced: about 1 year ago - Pushed: about 1 year ago

rxrddd/austin-v2
基于kratos 的聚合消息推送平台
  • v4.15.0 go.mod
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.12.1-0.20210724153913-640aa07df17c go.sum
  • v4.15.0 go.sum

Size: 1.77 MB - Last synced: about 1 year ago - Pushed: about 1 year ago

influxdata/influxdb-observability
  • v4.15.0 tests-integration/go.sum

Size: 2.21 MB - Last synced: 12 days ago - Pushed: 12 days ago

Boroda76/go_service_naked
  • v4.14.1 go.mod
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.5.0 go.sum
  • v4.6.1-0.20200510190926-94ba730bb1e9 go.sum
  • v4.6.1-0.20200606145419-4e5062306904 go.sum
  • v4.10.1 go.sum
  • v4.12.1-0.20210724153913-640aa07df17c go.sum
  • v4.14.1 go.sum

Size: 791 KB - Last synced: 15 days ago - Pushed: about 1 year ago

GoogleCloudPlatform/gke-poc-toolkit
📦 Demo generator for Google Kubernetes Engine!
  • v4.13.0 analytics/go.mod
  • v4.0.0-20190420224344-cc3461e65d96 analytics/go.sum
  • v4.0.0-20190421002000-1b8f0016e912 analytics/go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 analytics/go.sum
  • v4.12.1-0.20210724153913-640aa07df17c analytics/go.sum
  • v4.13.0 analytics/go.sum

Size: 12.8 MB - Last synced: 6 days ago - Pushed: 6 days ago

auliawiguna/goshaka-starter
REST API boilerplate using Go, Fiber Framework, JWT, GORM, Swagger, Rate Limiter
  • v4.17.2 go.mod
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.12.1-0.20210724153913-640aa07df17c go.sum
  • v4.17.2 go.sum

Size: 9.16 MB - Last synced: 9 months ago - Pushed: 12 months ago

drh-determined-ai/determined Fork of determined-ai/determined
Determined: Deep Learning Training Platform
  • v4.12.0 agent/go.mod
  • v4.0.0-20190420224344-cc3461e65d96 agent/go.sum
  • v4.0.0-20190421002000-1b8f0016e912 agent/go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 agent/go.sum
  • v4.5.0 agent/go.sum
  • v4.6.1-0.20200510190926-94ba730bb1e9 agent/go.sum
  • v4.6.1-0.20200606145419-4e5062306904 agent/go.sum
  • v4.11.0 agent/go.sum
  • v4.12.0 agent/go.sum
  • v4.12.0 master/go.mod
  • v4.0.0-20190420224344-cc3461e65d96 master/go.sum
  • v4.0.0-20190421002000-1b8f0016e912 master/go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 master/go.sum
  • v4.5.0 master/go.sum
  • v4.6.1-0.20200510190926-94ba730bb1e9 master/go.sum
  • v4.6.1-0.20200606145419-4e5062306904 master/go.sum
  • v4.11.0 master/go.sum
  • v4.12.0 master/go.sum

Size: 114 MB - Last synced: almost 1 year ago - Pushed: almost 1 year ago

Shashankreddysunkara/NavVis-go-webapp
  • v4.14.0 go.mod
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.12.1-0.20210724153913-640aa07df17c go.sum
  • v4.14.0 go.sum

Size: 701 KB - Last synced: about 1 year ago - Pushed: about 1 year ago

create-go-app/fiber-go-template
📝 Production-ready backend template with Fiber Go Web Framework for Create Go App CLI.
  • v4.16.1 go.mod
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.12.1-0.20210724153913-640aa07df17c go.sum
  • v4.16.1 go.sum

Size: 641 KB - Last synced: 13 days ago - Pushed: 14 days ago

BlackRRR/payment-emulator
  • v4.16.1 go.mod
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.12.1-0.20210724153913-640aa07df17c go.sum
  • v4.16.1 go.sum

Size: 45.9 KB - Last synced: about 1 year ago - Pushed: almost 2 years ago

moov-io/irs
Internal Revenue Service (IRS) Filing Information Returns Electronically (FIRE)
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.5.0 go.sum
  • v4.6.1-0.20200510190926-94ba730bb1e9 go.sum
  • v4.6.1-0.20200606145419-4e5062306904 go.sum
  • v4.10.1 go.sum

Size: 1.4 MB - Last synced: 20 days ago - Pushed: 25 days ago

moov-io/ach-test-harness
Programmatic and configurable ACH scenario testing of returns, NOC/corrections, reconciliation, etc.
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum
  • v4.5.0 go.sum
  • v4.6.1-0.20200510190926-94ba730bb1e9 go.sum
  • v4.6.1-0.20200606145419-4e5062306904 go.sum
  • v4.10.1 go.sum

Size: 950 KB - Last synced: 1 day ago - Pushed: 2 days ago

rogue73/hugo Fork of gohugoio/hugo
The world’s fastest framework for building websites.
  • v4.0.0-20190420224344-cc3461e65d96 go.sum
  • v4.0.0-20190421002000-1b8f0016e912 go.sum
  • v4.0.0-pre1.0.20190824185557-6972a5742186 go.sum

Size: 109 MB - Last synced: about 1 year ago - Pushed: about 1 year ago