x-database-patterns

Official

Design clean PostgreSQL repo and transactions.

Authorpure-golang
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: x-database-patterns
Download link: https://github.com/pure-golang/level85/archive/main.zip#x-database-patterns

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.