
Golang Database
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-codeInstalls 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-databaseskill 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- Golang Safety42.2K
- Golang Project Layout42.1K
- Golang Documentation42K
- Golang Modernize42K
- Golang Lint41.9K
- Golang Data Structures41.8K
- Golang Troubleshooting41.6K
- Golang Observability41.5K
- Golang Dependency Management41.4K
- Golang Structs Interfaces41.3K
- Golang Cli41.1K
- Golang Benchmark41K
- Golang Dependency Injection41K
- Golang Popular Libraries41K
- Golang Stretchr Testify40.9K
- Golang Continuous Integration40.9K
- Golang Grpc40.7K
- Golang Samber Lo40K
- Golang Stay Updated40K
- Golang Samber Do39.8K
- Golang Samber Slog39.8K
- Golang Samber Oops39.7K
- Golang Samber Mo39.7K
- Golang Samber Hot39.7K