golang-database

Community

Go database best practices, without ORMs.

Authorsamber
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Parameterized, context-aware, observable database access in Go—without relying on ORMs or opaque abstractions, enabling safer and clearer data interactions.

Core Features & Use Cases

  • Parameterized queries and explicit error handling to distinguish not-found and real failures.
  • Context propagation for every DB operation and consistent use of QueryContext / GetContext / ExecContext.
  • Transaction patterns with BeginTx, proper rollback handling, and selective isolation levels.
  • NULL handling with pointer fields and proper struct scanning for sqlx and pgx.
  • Testing patterns: unit tests with mocks and integration tests against a real database.

Quick Start

Create a minimal Go data layer using sqlx that queries a PostgreSQL table with parameterized SQL and returns results.

Dependency Matrix

Required Modules

None required

Components

references

💻 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
Download link: https://github.com/samber/cc-skills-golang/archive/main.zip#golang-database

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 471,000+ vetted skills library on demand.