A solid, opinionated guide for writing database code in Go the explicit way: parameterized queries, manual struct scanning with sqlx or pgx, no ORMs. It walks through the fundamentals like context propagation, closing rows, handling sql.ErrNoRows, and transaction patterns including SELECT FOR UPDATE and custom isolation levels. The persona is clear: treat SQL as first-class, catch issues at the boundary, and use external migration tools instead of letting AI generate schema changes. Refreshingly prescriptive about connection pooling, batch sizes, and why magic hooks make debugging harder. If you're building Go services that talk to Postgres, MySQL, or SQLite and want guardrails against the common footguns, this gives you a working checklist and concrete examples.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
7
skills.sh installs
42.5K
GitHub stars
3.8K
last updated
Aug 21, 2026

Install

$ npx -y skills add samber/cc-skills-golang --skill golang-database --agent claude-code

Installs into .claude/skills of the current project.

Files

Persona: You are a Go backend engineer who writes safe, explicit, and observable database code. You treat SQL as a first-class language — no ORMs, no magic — and you catch data integrity issues at the boundary, not deep in the application.

Modes:

  • Write mode — generating new repository functions, query helpers, or transaction wrappers: follow the skill's sequential instructions; launch a background agent to grep for existing query patterns and naming conventions in the codebase before generating new code.
  • Review/debug mode — auditing or debugging existing database code: use a sub-agent to scan for missing rows.Close(), un-parameterized queries, missing context propagation, and absent error checks in parallel with reading the business logic.

Community default. A company skill that explicitly supersedes samber/cc-skills-golang@golang-database skill takes precedence.

Go Database Best Practices

Go's database/sql provides a solid foundation for database access. Use sqlx or pgx on top of it for ergonomics — never an ORM.

When using sqlx or pgx, refer to the library's official documentation and code examples for current API signatures.

Sponsors

Details

Repository
github.com/samber/cc-skills-golang
Categories
Backend & APIs, Testing & QA, Documentation, Debugging, Automation & Workflows, Go, Databases
First seen
Apr 16, 2026

More from samber/cc-skills-golang

All 47
1neondatabase avatarneon-ai-gatewayneondatabase/agent-skillsOne API and one credential for frontier and open-source LLMs and embedding models, built into your Neon branch and powered by Databricks. Use when a user wants 39.8Kskills.sh installs
2better-auth avatartwo-factor-authentication-best-practicesbetter-auth/skillsMulti-factor authentication with TOTP, OTP, backup codes, and trusted device management for Better Auth.36.5Kskills.sh installs
3wshobson avatarapi-design-principleswshobson/agentsMaster REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewin31.3Kskills.sh installs
4better-auth avatarcreate-authbetter-auth/skillsScaffold and implement authentication in TypeScript/JavaScript apps with Better Auth framework detection, database adapter setup, and OAuth integration.29.3Kskills.sh installs
5google-gemini avatargemini-live-api-devgoogle-gemini/gemini-skillsUse this skill when building real-time, bidirectional streaming applications with the Gemini Live API. Covers WebSocket-based audio/video/text streaming, voice 10.8Kskills.sh installs
6github avatartypespec-create-api-plugingithub/awesome-copilotGenerate a TypeSpec API plugin with REST operations, authentication, and Adaptive Cards for Microsoft 365 Copilot8.7Kskills.sh installs