feat(v2/postgres): expose pgxpool.Pool for pgx-native operations

What

Switches the postgres.Client internals from stdlib.OpenDB to pgxpool.Pool + stdlib.OpenDBFromPool, and exposes the pool via a new Pool() *pgxpool.Pool method.

Why

The previous implementation used stdlib.OpenDB(*pgx.ConnConfig), which creates a *sql.DB backed by a simple per-request connection — not a proper pool. This meant:

  1. Connection pooling was handled by database/sql's own (minimal) pool, not pgx's purpose-built pgxpool
  2. pgx-native features were completely inaccessible: COPY FROM/TO, batch queries, named prepared statements, LISTEN/NOTIFY

Services needing bulk inserts, high-throughput batching, or event-driven patterns had no path forward within the labkit abstraction.

Changes

client.go

  • Internals: stdlib.OpenDBpgxpool.NewWithConfig + stdlib.OpenDBFromPool
  • New method: Pool() *pgxpool.Pool — returns nil before Start
  • New config field: MinConns int — keep N connections warm (maps to pgxpool.Config.MinConns)
  • Deprecated config field: MaxIdleConns — not meaningful with pgxpool; documented with clear guidance on alternatives

Backward compatibility

  • DB() still returns *sql.DB — existing consumers unchanged
  • All existing Config fields still accepted; MaxConns, ConnMaxLifetime, ConnMaxIdleTime map to their pgxpool equivalents
  • MaxIdleConns is silently ignored (was previously db.SetMaxIdleConns)

README.md — new file with capability comparison table, both access paths with code examples, PgBouncer guidance, and testing patterns

doc.go — updated to document both access paths

example_test.go — new file showing Pool() and MinConns

client_test.goTestPool_NilBeforeStart added

Merge request reports

Loading