{"owner":"jackc","repo":"pgx","hasSkills":true,"hasMcp":false,"mcpConfig":null,"found":["CLAUDE.md"],"skills":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\npgx is a PostgreSQL driver and toolkit for Go (`github.com/jackc/pgx/v5`). It provides both a native PostgreSQL interface and a `database/sql` compatible driver. Requires Go 1.25+ and supports PostgreSQL 14+ and CockroachDB.\n\n## Build & Test Commands\n\n```bash\n# Run all tests (requires PGX_TEST_DATABASE to be set)\ngo test ./...\n\n# Run a specific test\ngo test -run TestFunctionName ./...\n\n# Run tests for a specific package\ngo test ./pgconn/...\n\n# Run tests with race detector\ngo test -race ./...\n\n# DevContainer: run tests against specific PostgreSQL versions\n./test.sh pg18                      # Default: PostgreSQL 18\n./test.sh pg16 -run TestConnect     # Specific test against PG16\n./test.sh crdb                      # CockroachDB\n./test.sh all                       # All targets (pg14-18 + crdb)\n\n# Format (always run after making changes)\ngoimports -w .\n\n# Lint\ngolangci-lint run ./...\n```\n\n## Test Database Setup\n\nTests require `PGX_TEST_DATABASE` environment variable. In the devcontainer, `test.sh` handles this. For local development:\n\n```bash\nexport PGX_TEST_DATABASE=\"host=localhost user=postgres password=postgres dbname=pgx_test\"\n```\n\nThe test database needs extensions: `hstore`, `ltree`, and a `uint64` domain. See `testsetup/postgresql_setup.sql` for full setup. Many tests are skipped unless additional `PGX_TEST_*` env vars are set (for TLS, SCRAM, MD5, unix socket, PgBouncer testing).\n\n## Architecture\n\nThe codebase is a layered architecture, bottom-up:\n\n- **pgproto3/** — PostgreSQL wire protocol v3 encoder/decoder. Defines `FrontendMessage` and `BackendMessage` types for every protocol message.\n- **pgconn/** — Low-level connection layer (roughly libpq-equivalent). Handles authentication, TLS, query execution, COPY protocol, and notifications. `PgConn` is the core type.\n- **pgx** (root package) — High-level query interface built on `pgconn`. Provides `Conn`, `Rows`, `Tx`, `Batch`, `CopyFrom`, and generic helpers like `CollectRows`/`ForEachRow`. Includes automatic statement caching (LRU).\n- **pgtype/** — Type system mapping between Go and PostgreSQL types (70+ types). Key interfaces: `Codec`, `Type`, `TypeMap`. Custom types (enums, composites, domains) are registered through `TypeMap`.\n- **pgxpool/** — Concurrency-safe connection pool built on `puddle/v2`. `Pool` is the main type; wraps `pgx.Conn`.\n- **stdlib/** — `database/sql` compatibility adapter.\n\nSupporting packages:\n- **internal/stmtcache/** — Prepared statement cache with LRU eviction\n- **internal/sanitize/** — SQL query sanitization\n- **tracelog/** — Logging adapter that implements tracer interfaces\n- **multitracer/** — Composes multiple tracers into one\n- **pgxtest/** — Test helpers for running tests across connection types\n\n## Key Design Conventions\n\n- **Semantic versioning** — strictly followed. Do not break the public API (no removing or renaming exported types, functions, methods, or fields; no changing function signatures).\n- **Minimal dependencies** — adding new dependencies is strongly discouraged (see CONTRIBUTING.md).\n- **Context-based** — all blocking operations take `context.Context`.\n- **Tracer interfaces** — observability via `QueryTracer`, `BatchTracer`, `CopyFromTracer`, `PrepareTracer` on `ConnConfig.Tracer`.\n- **Formatting** — always run `goimports -w .` after making changes to ensure code is properly formatted. CI checks formatting via `gofmt -l -s -w . && git diff --exit-code`. `gofumpt` with extra rules is also enforced via `golangci-lint`.\n- **Linters** — `govet`, `ineffassign`, and `unconvert` only (configured in `.golangci.yml`).\n- **CI matrix** — tests run against Go 1.25/1.26 × PostgreSQL 14-18 + CockroachDB, on Linux and Windows. Race detector enabled on Linux only.\n"},"files":{"CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\npgx is a PostgreSQL driver and toolkit for Go (`github.com/jackc/pgx/v5`). It provides both a native PostgreSQL interface and a `database/sql` compatible driver. Requires Go 1.25+ and supports PostgreSQL 14+ and CockroachDB.\n\n## Build & Test Commands\n\n```bash\n# Run all tests (requires PGX_TEST_DATABASE to be set)\ngo test ./...\n\n# Run a specific test\ngo test -run TestFunctionName ./...\n\n# Run tests for a specific package\ngo test ./pgconn/...\n\n# Run tests with race detector\ngo test -race ./...\n\n# DevContainer: run tests against specific PostgreSQL versions\n./test.sh pg18                      # Default: PostgreSQL 18\n./test.sh pg16 -run TestConnect     # Specific test against PG16\n./test.sh crdb                      # CockroachDB\n./test.sh all                       # All targets (pg14-18 + crdb)\n\n# Format (always run after making changes)\ngoimports -w .\n\n# Lint\ngolangci-lint run ./...\n```\n\n## Test Database Setup\n\nTests require `PGX_TEST_DATABASE` environment variable. In the devcontainer, `test.sh` handles this. For local development:\n\n```bash\nexport PGX_TEST_DATABASE=\"host=localhost user=postgres password=postgres dbname=pgx_test\"\n```\n\nThe test database needs extensions: `hstore`, `ltree`, and a `uint64` domain. See `testsetup/postgresql_setup.sql` for full setup. Many tests are skipped unless additional `PGX_TEST_*` env vars are set (for TLS, SCRAM, MD5, unix socket, PgBouncer testing).\n\n## Architecture\n\nThe codebase is a layered architecture, bottom-up:\n\n- **pgproto3/** — PostgreSQL wire protocol v3 encoder/decoder. Defines `FrontendMessage` and `BackendMessage` types for every protocol message.\n- **pgconn/** — Low-level connection layer (roughly libpq-equivalent). Handles authentication, TLS, query execution, COPY protocol, and notifications. `PgConn` is the core type.\n- **pgx** (root package) — High-level query interface built on `pgconn`. Provides `Conn`, `Rows`, `Tx`, `Batch`, `CopyFrom`, and generic helpers like `CollectRows`/`ForEachRow`. Includes automatic statement caching (LRU).\n- **pgtype/** — Type system mapping between Go and PostgreSQL types (70+ types). Key interfaces: `Codec`, `Type`, `TypeMap`. Custom types (enums, composites, domains) are registered through `TypeMap`.\n- **pgxpool/** — Concurrency-safe connection pool built on `puddle/v2`. `Pool` is the main type; wraps `pgx.Conn`.\n- **stdlib/** — `database/sql` compatibility adapter.\n\nSupporting packages:\n- **internal/stmtcache/** — Prepared statement cache with LRU eviction\n- **internal/sanitize/** — SQL query sanitization\n- **tracelog/** — Logging adapter that implements tracer interfaces\n- **multitracer/** — Composes multiple tracers into one\n- **pgxtest/** — Test helpers for running tests across connection types\n\n## Key Design Conventions\n\n- **Semantic versioning** — strictly followed. Do not break the public API (no removing or renaming exported types, functions, methods, or fields; no changing function signatures).\n- **Minimal dependencies** — adding new dependencies is strongly discouraged (see CONTRIBUTING.md).\n- **Context-based** — all blocking operations take `context.Context`.\n- **Tracer interfaces** — observability via `QueryTracer`, `BatchTracer`, `CopyFromTracer`, `PrepareTracer` on `ConnConfig.Tracer`.\n- **Formatting** — always run `goimports -w .` after making changes to ensure code is properly formatted. CI checks formatting via `gofmt -l -s -w . && git diff --exit-code`. `gofumpt` with extra rules is also enforced via `golangci-lint`.\n- **Linters** — `govet`, `ineffassign`, and `unconvert` only (configured in `.golangci.yml`).\n- **CI matrix** — tests run against Go 1.25/1.26 × PostgreSQL 14-18 + CockroachDB, on Linux and Windows. Race detector enabled on Linux only.\n"},"items":[{"name":"CLAUDE.md","path":"CLAUDE.md","title":"CLAUDE.md","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\n## Project Overview\n\npgx is a PostgreSQL driver and toolkit for Go (`github.com/jackc/pgx/v5`). It provides both a native PostgreSQL interface and a `database/sql` compatible driver. Requires Go 1.25+ and supports PostgreSQL 14+ and CockroachDB.\n\n## Build & Test Commands\n\n```bash\n# Run all tests (requires PGX_TEST_DATABASE to be set)\ngo test ./...\n\n# Run a specific test\ngo test -run TestFunctionName ./...\n\n# Run tests for a specific package\ngo test ./pgconn/...\n\n# Run tests with race detector\ngo test -race ./...\n\n# DevContainer: run tests against specific PostgreSQL versions\n./test.sh pg18                      # Default: PostgreSQL 18\n./test.sh pg16 -run TestConnect     # Specific test against PG16\n./test.sh crdb                      # CockroachDB\n./test.sh all                       # All targets (pg14-18 + crdb)\n\n# Format (always run after making changes)\ngoimports -w .\n\n# Lint\ngolangci-lint run ./...\n```\n\n## Test Database Setup\n\nTests require `PGX_TEST_DATABASE` environment variable. In the devcontainer, `test.sh` handles this. For local development:\n\n```bash\nexport PGX_TEST_DATABASE=\"host=localhost user=postgres password=postgres dbname=pgx_test\"\n```\n\nThe test database needs extensions: `hstore`, `ltree`, and a `uint64` domain. See `testsetup/postgresql_setup.sql` for full setup. Many tests are skipped unless additional `PGX_TEST_*` env vars are set (for TLS, SCRAM, MD5, unix socket, PgBouncer testing).\n\n## Architecture\n\nThe codebase is a layered architecture, bottom-up:\n\n- **pgproto3/** — PostgreSQL wire protocol v3 encoder/decoder. Defines `FrontendMessage` and `BackendMessage` types for every protocol message.\n- **pgconn/** — Low-level connection layer (roughly libpq-equivalent). Handles authentication, TLS, query execution, COPY protocol, and notifications. `PgConn` is the core type.\n- **pgx** (root package) — High-level query interface built on `pgconn`. Provides `Conn`, `Rows`, `Tx`, `Batch`, `CopyFrom`, and generic helpers like `CollectRows`/`ForEachRow`. Includes automatic statement caching (LRU).\n- **pgtype/** — Type system mapping between Go and PostgreSQL types (70+ types). Key interfaces: `Codec`, `Type`, `TypeMap`. Custom types (enums, composites, domains) are registered through `TypeMap`.\n- **pgxpool/** — Concurrency-safe connection pool built on `puddle/v2`. `Pool` is the main type; wraps `pgx.Conn`.\n- **stdlib/** — `database/sql` compatibility adapter.\n\nSupporting packages:\n- **internal/stmtcache/** — Prepared statement cache with LRU eviction\n- **internal/sanitize/** — SQL query sanitization\n- **tracelog/** — Logging adapter that implements tracer interfaces\n- **multitracer/** — Composes multiple tracers into one\n- **pgxtest/** — Test helpers for running tests across connection types\n\n## Key Design Conventions\n\n- **Semantic versioning** — strictly followed. Do not break the public API (no removing or renaming exported types, functions, methods, or fields; no changing function signatures).\n- **Minimal dependencies** — adding new dependencies is strongly discouraged (see CONTRIBUTING.md).\n- **Context-based** — all blocking operations take `context.Context`.\n- **Tracer interfaces** — observability via `QueryTracer`, `BatchTracer`, `CopyFromTracer`, `PrepareTracer` on `ConnConfig.Tracer`.\n- **Formatting** — always run `goimports -w .` after making changes to ensure code is properly formatted. CI checks formatting via `gofmt -l -s -w . && git diff --exit-code`. `gofumpt` with extra rules is also enforced via `golangci-lint`.\n- **Linters** — `govet`, `ineffassign`, and `unconvert` only (configured in `.golangci.yml`).\n- **CI matrix** — tests run against Go 1.25/1.26 × PostgreSQL 14-18 + CockroachDB, on Linux and Windows. Race detector enabled on Linux only.\n","category":"root","tokens":965}]}