db-patterns

Implement PostgreSQL repository patterns in Go with pgx and migrations.

1|Updated Mar 23, 2026
One-click install
npx skills add https://github.com/RaNDoM6913/claude-code-superkit --skill db-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-patterns
Source: https://github.com/RaNDoM6913/claude-code-superkit/tree/main/packages/showcase/.claude/skills/db-patterns
Command: npx skills add https://github.com/RaNDoM6913/claude-code-superkit --skill db-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

A ready-to-use blueprint for building robust PostgreSQL data access layers in Go without an ORM, reducing boilerplate and risk across services.

Core Features & Use Cases

  • Repository pattern implementation for Go services using pgx with a zero-ORM approach.
  • Migrations organization and conventions (backend/migrations) with standard up/down scripts and versioning.
  • Consistent error wrapping, debug-friendly query patterns, and JSONB usage for flexible data modeling.
  • Connection pooling with pgxpool and patterns for Redis-backed session storage and caching.
  • Use cases include building scalable data access layers for microservices, audit trails, and high-traffic apps.

Quick Start

Apply this pattern by wiring a pgxpool connection, implementing repository methods, and running migrations to bootstrap your database layer.

Frequently Asked Questions about db-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement the repository pattern in Go without an ORM?

You can implement the repository pattern in Go without an ORM by using pgx for direct SQL queries. This blueprint provides a zero-ORM approach with consistent error wrapping and debug-friendly query patterns to reduce boilerplate.

What is the best way to organize PostgreSQL migrations for Go services?

Organize PostgreSQL migrations in a backend/migrations directory with standard up/down scripts and versioning. This provides consistent schema management and reliable database bootstrapping for Go services.

Does this PostgreSQL data access blueprint support Redis for caching?

Yes, this PostgreSQL blueprint supports Redis integration. It includes patterns for Redis-backed session storage and caching alongside the pgxpool connection pool for scalable backend data access.

Can I use JSONB for flexible data modeling with pgx in Go?

Yes, you can use JSONB for flexible data modeling with pgx in Go. This blueprint enforces JSONB usage to enable flexible data structures while maintaining a robust, zero-ORM data access layer.

When do I need a connection pool for PostgreSQL in Go microservices?

You need a connection pool for PostgreSQL in Go microservices when building high-traffic applications and audit trails. Using pgxpool manages database connections efficiently and ensures scalable data access.