What problem does it solve?
This Skill helps you prevent common database bugs in Go by enforcing parameterized SQL, correct context propagation, reliable row handling, safe transactions, and production-safe patterns for scanning, NULLs, and error handling.
Core Features & Use Cases
- Parameterize every query: avoids SQL injection by banning string-built predicates and requiring driver-appropriate placeholders.
- Correct database/sql usage: enforces the *Context method variants, explicit
sql.ErrNoRows handling, and guaranteed rows.Close() plus rows.Err() checks.
- Production-grade safety patterns: guides transactions (with proper isolation levels),
SELECT ... FOR UPDATE locking, NULLable column modeling, connection pool sizing, and bulk/batch processing heuristics.
- Scope control: explicitly covers database access practices and debugging, while refusing to generate schema- or migration-defining SQL.
Quick Start
Use golang-database to implement or review a Go repository method that uses sqlx or pgx with safe parameterized queries, context-aware calls, correct scanning (including NULLable columns), and robust transaction behavior.