pgx

package module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package pgx profiles native pgx queries without routing them through database/sql.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProfileConfig

func ProfileConfig(config *pgx.ConnConfig, configs ...Config) *pgx.ConnConfig

ProfileConfig returns a copy of config with the default profiler tracer appended. Existing pgx tracers remain active.

func ProfileConfigWith

func ProfileConfigWith(profiler *webpprof.Profiler, config *pgx.ConnConfig, configs ...Config) *pgx.ConnConfig

ProfileConfigWith returns a copy of config with profiler attached. The original config is never mutated.

func ProfilePoolConfig

func ProfilePoolConfig(config *pgxpool.Config, configs ...Config) *pgxpool.Config

ProfilePoolConfig returns a copy of a pgxpool config with native query tracing attached to its connection config.

func ProfilePoolConfigWith

func ProfilePoolConfigWith(profiler *webpprof.Profiler, config *pgxpool.Config, configs ...Config) *pgxpool.Config

ProfilePoolConfigWith is ProfilePoolConfig using an explicit profiler.

Types

type Config

type Config struct {
	Connection     string
	Database       string
	Explain        bool
	ExplainTimeout time.Duration
	ExplainMaxRows int
}

Config names the connection and database shown in captured Query entries and controls optional non-executing EXPLAIN capture.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL