Categorygithub.com/stumble/wpgx
modulepackage
0.3.2
Repository: https://github.com/stumble/wpgx.git
Documentation: pkg.go.dev

# README

Wrapped pgx

Wrapped pgx is a simple wrap on the PostgreSQL driver library pgx. It is used by sqlc, providing telementry for generated code.

Components:

  • Pool: a wrapper of pgxpool.Pool. It manages a set of connection pools, including a primary pool and a set of replica pools. We assume replica pools are heterogeneous read-only replicas, meaning some replicas can be a partial copy of the primary database, using logical replication.
  • WConn: a connection wrapper, implementing "WGConn".
  • WTx: a transaction wrapper, implementing "WGConn".

# Packages

No description provided by the author

# Functions

No description provided by the author
No description provided by the author
NewPool creates a new Pool with the given context and config.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
ReservedReplicaNamePrimary is the name of the primary replica.

# Variables

ErrReplicaNotFound is the error when the replica is not found.

# Structs

Config is the configuration for the WPgx.
Pool is the wrapped pgx pool that registers Prometheus.
No description provided by the author
No description provided by the author
WTx is a wrapped pgx.Tx.

# Interfaces

WCopyFromer is the abstraction of connections that can use PostgreSQL's copyfrom.
WExecer is the abstraction of connections that can execute mutations.
WGConn is the abstraction over wrapped connections and transactions.
WQuerier is the abstraction of connections that are read-only.

# Type aliases

PostExecFunc is the function that must be ran after a successful CRUD.
ReplicaName is the name of the replica instance.
TxFunc is the body of a transaction.