What problem does it solve?
This skill helps you structure PostgreSQL access in a Go service or adapter so that database drivers, repository boundaries, transactions across repos, and constraint error handling are consistent and maintainable.
Core Features & Use Cases
- Driver choice & data modeling guidance: Decide between pgx and sqlx based on project needs and avoid using JSONB as the primary data model when constraints/search/join logic matters.
- Repository layer design with shared dbQuerier: Build a repo package layout that keeps constructors side-effect free and uses a common dbQuerier contract for both pools and transactions.
- Transaction and constraint error handling: Pass a single transaction into multiple repos for cross-repository operations and handle constraint errors via sqlx helper functions.
Quick Start
Ask the assistant to design your PostgreSQL repo layer for a Go service using pgx, including a shared dbQuerier, cross-repository transactions, and constraint-error handling strategy.