golang-database-patterns

Installation
SKILL.md

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

Activate this skill when:

  • Building CRUD operations with type safety
Related skills
Installs
206
GitHub Stars
44
First Seen
Jan 23, 2026