Skip to content
bobmatnyc avatar

Golang Database Patterns

Go database patterns covering database/sql, sqlx, pgx, and golang-migrate for type-safe data access layers.

CCM score
55 of 100
skills.sh installs
423
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers library selection among database/sql, sqlx, and pgx, plus connection pooling, transactions, and repository patterns
  • Includes runnable examples for CRUD queries, named parameters, IN-clause expansion, and pgxpool setup
  • Requires defer rows.Close() and a rows.Err() check after iteration, with errors wrapped using %w
  • Designed for Go services that need SQL-first data access and schema migrations managed with golang-migrate

Install

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

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

Details

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

Questions

Where does golang-database-patterns rank among Go skills on Claude Marketplaces?

golang-database-patterns ranks in the top 100 of the Go category on Claude Marketplaces. Its sibling skills in that category include golang-code-style, golang-testing, golang-error-handling, golang-design-patterns and golang-concurrency, which cover other parts of Go development. This skill focuses on database integration with sqlx, pgx and golang-migrate.

What does the golang-database-patterns skill cover?

It covers Go database integration patterns using sqlx, pgx and migration tools like golang-migrate. The skill walks through choosing between database/sql, sqlx and pgx, setting up connection pooling, writing query and transaction code, and managing schema migrations. It is aimed at developers building data access layers in Go.

How do I install golang-database-patterns?

Run npx -y skills add bobmatnyc/claude-mpm-skills --skill golang-database-patterns -y in your project. Once installed, the skill gives the agent Go database patterns for CRUD operations, repository design, transactions and migrations.

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Golang Database Patterns

More Go