golang-database-patterns
OfficialMaster Go DB access and migrations
Authoronlyspans
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides comprehensive guidance and practical examples for interacting with SQL databases in Go, covering everything from basic queries to advanced patterns like connection pooling, transaction management, and schema migrations.
Core Features & Use Cases
- Database Library Selection: Guides you in choosing between
database/sql,sqlx, andpgxbased on your needs. - Repository Pattern: Demonstrates how to implement an interface-based repository pattern for testable and maintainable data access.
- Migrations: Explains how to use
golang-migratefor robust database schema versioning. - Transaction Handling: Covers safe transaction management, isolation levels, and retry logic.
- Use Case: When building a new Go web service that requires a PostgreSQL backend, use this Skill to set up your database connection, implement user data CRUD operations using
sqlx, and manage your schema withgolang-migrate.
Quick Start
Use the golang-database-patterns skill to set up a connection pool using pgx and implement a user repository with Create, GetByID, and Update methods.
Dependency Matrix
Required Modules
None requiredComponents
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/onlyspans/events/archive/main.zip#golang-database-patterns Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.