bobmatnyc avatar

Golang Database Patterns

This walks you through the three main layers of Go's SQL tooling: the standard library's database/sql, sqlx for struct scanning and named queries, and pgx when you need PostgreSQL-specific performance. It covers repository patterns for testing, migration workflows with golang-migrate, and connection pooling setup. Basically the practical stuff you'd want when moving past tutorial code into production database work. The 200+ installs suggest people are reaching for this when they're tired of cobbling together database patterns from scratch or want a reference for the pgx vs sqlx decision.

skills.sh installs
414
GitHub stars
79
last updated
Aug 21, 2026

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill golang-database-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

Go Database Patterns

Overview

Go's database ecosystem provides multiple layers of abstraction for SQL database integration. From the standard library's database/sql to enhanced libraries like sqlx and PostgreSQL-optimized pgx, developers can choose the right tool for their performance and ergonomics needs.

Key Features:

  • 🔌 database/sql: Standard interface for any SQL database
  • 🚀 sqlx: Convenience methods with struct scanning and named queries
  • 🐘 pgx: PostgreSQL-native driver with maximum performance
  • 📦 Repository Pattern: Interface-based data access for testability
  • 🔄 Migrations: Schema versioning with golang-migrate
  • ⚡ Connection Pooling: Production-ready connection management
  • 🔒 Transaction Safety: Context-aware transaction handling

When to Use This Skill

Sponsors

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Backend & APIs, Go, Databases
First seen
Jun 3, 2026

More from bobmatnyc/claude-mpm-skills

All 158
1sickn33 avatardatabase-migrationsickn33/antigravity-awesome-skillsdatabase migration398skills.sh installs
2kernel avatarkernel-authkernel/skillsUse Kernel managed auth whenever an agent needs to do something on a website as a logged-in user, including browsing, operating, automating, testing, debugging,397skills.sh installs
3bobmatnyc avatarapi-documentationbobmatnyc/claude-mpm-skillsBest practices for documenting APIs and code interfaces, eliminating redundant documentation guidance per agent.389skills.sh installs
4firebase avatarfirebase-firestore-standardfirebase/skillsfirebase firestore standard358skills.sh installs
5letta-ai avatarletta-api-clientletta-ai/skillsBuild applications with the Letta API — a model-agnostic, stateful API for building persistent agents with memory and long-term learning. Covers SDK patterns fo355skills.sh installs
6pedronauck avatarevolution-apipedronauck/skillsEvolution API integration for WhatsApp messaging, instance management, webhooks, and chatbot orchestration. Use when: (1) Creating or managing WhatsApp instance344skills.sh installs