Versions in this module Expand all Collapse all v1 v1.0.3 Feb 4, 2025 v1.0.2 Feb 4, 2025 Changes in this version + type AcquireTracer interface + TraceAcquireEnd func(ctx context.Context, pool *Pool, data TraceAcquireEndData) + TraceAcquireStart func(ctx context.Context, pool *Pool, data TraceAcquireStartData) context.Context + type Config struct + AfterConnect func(context.Context, *pgx.Conn) error + AfterRelease func(*pgx.Conn) bool + BeforeAcquire func(context.Context, *pgx.Conn) bool + BeforeClose func(*pgx.Conn) + BeforeConnect func(context.Context, *pgx.ConnConfig) error + ConnConfig *pgx.ConnConfig + HealthCheckPeriod time.Duration + MaxConnIdleTime time.Duration + MaxConnLifetime time.Duration + MaxConnLifetimeJitter time.Duration + MaxConns int32 + MinConns int32 + func ParseConfig(connString string) (*Config, error) + func (c *Config) ConnString() string + func (c *Config) Copy() *Config + type Conn struct + func (c *Conn) Begin(ctx context.Context) (pgx.Tx, error) + func (c *Conn) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) + func (c *Conn) Conn() *pgx.Conn + func (c *Conn) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error) + func (c *Conn) Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error) + func (c *Conn) Hijack() *pgx.Conn + func (c *Conn) Ping(ctx context.Context) error + func (c *Conn) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error) + func (c *Conn) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row + func (c *Conn) Release() + func (c *Conn) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults + type Pool struct + func New(ctx context.Context, connString string) (*Pool, error) + func NewWithConfig(ctx context.Context, config *Config) (*Pool, error) + func (p *Pool) Acquire(ctx context.Context) (c *Conn, err error) + func (p *Pool) AcquireAllIdle(ctx context.Context) []*Conn + func (p *Pool) AcquireFunc(ctx context.Context, f func(*Conn) error) error + func (p *Pool) Begin(ctx context.Context) (pgx.Tx, error) + func (p *Pool) BeginTx(ctx context.Context, txOptions pgx.TxOptions) (pgx.Tx, error) + func (p *Pool) Close() + func (p *Pool) Config() *Config + func (p *Pool) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error) + func (p *Pool) Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error) + func (p *Pool) Ping(ctx context.Context) error + func (p *Pool) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error) + func (p *Pool) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row + func (p *Pool) Reset() + func (p *Pool) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults + func (p *Pool) Stat() *Stat + type ReleaseTracer interface + TraceRelease func(pool *Pool, data TraceReleaseData) + type Stat struct + func (s *Stat) AcquireCount() int64 + func (s *Stat) AcquireDuration() time.Duration + func (s *Stat) AcquiredConns() int32 + func (s *Stat) CanceledAcquireCount() int64 + func (s *Stat) ConstructingConns() int32 + func (s *Stat) EmptyAcquireCount() int64 + func (s *Stat) EmptyAcquireWaitTime() time.Duration + func (s *Stat) IdleConns() int32 + func (s *Stat) MaxConns() int32 + func (s *Stat) MaxIdleDestroyCount() int64 + func (s *Stat) MaxLifetimeDestroyCount() int64 + func (s *Stat) NewConnsCount() int64 + func (s *Stat) TotalConns() int32 + type TraceAcquireEndData struct + Conn *pgx.Conn + Err error + type TraceAcquireStartData struct + type TraceReleaseData struct + Conn *pgx.Conn + type Tx struct + func (tx *Tx) Begin(ctx context.Context) (pgx.Tx, error) + func (tx *Tx) Commit(ctx context.Context) error + func (tx *Tx) Conn() *pgx.Conn + func (tx *Tx) CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, ...) (int64, error) + func (tx *Tx) Exec(ctx context.Context, sql string, arguments ...any) (pgconn.CommandTag, error) + func (tx *Tx) LargeObjects() pgx.LargeObjects + func (tx *Tx) Prepare(ctx context.Context, name, sql string) (*pgconn.StatementDescription, error) + func (tx *Tx) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error) + func (tx *Tx) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row + func (tx *Tx) Rollback(ctx context.Context) error + func (tx *Tx) SendBatch(ctx context.Context, b *pgx.Batch) pgx.BatchResults Other modules containing this package github.com/mark5cinco/pgx/v5