golang-database-patterns

Community

Master Go database integration.

Authorbobmatnyc
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides comprehensive guidance and code examples for effectively interacting with SQL databases in Go, covering everything from basic queries to advanced patterns like the repository pattern and transaction management.

Core Features & Use Cases

  • Database Libraries: Explores database/sql, sqlx, and pgx for different needs.
  • Repository Pattern: Demonstrates building testable, interface-based data access layers.
  • Migrations: Covers schema versioning using golang-migrate.
  • Transaction Handling: Details safe and robust transaction management, including retry logic.
  • Use Case: When building a new Go web service that requires robust user authentication and data storage, this Skill will guide you in setting up the database connection, defining user models, implementing CRUD operations, and managing schema changes.

Quick Start

Use the golang-database-patterns skill to set up a connection pool using pgx for a PostgreSQL database.

Dependency Matrix

Required Modules

github.com/jmoiron/sqlxgithub.com/jackc/pgx/v5github.com/golang-migrate/migrate/v4github.com/DATA-DOG/go-sqlmock

Components

scriptsreferences

💻 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: golang-database-patterns
Download link: https://github.com/bobmatnyc/claude-mpm-skills/archive/main.zip#golang-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 223,000+ vetted skills library on demand.