What problem does it solve?
This Skill helps you write, review, and debug Go code that talks to SQL databases without falling into common production traps like SQL injection, leaked connections, missing context propagation, and unsafe transaction handling.
Core Features & Use Cases
- Library selection: Choose between database/sql, sqlx, sqlc, pgx, and when to avoid ORMs like GORM or ent.
- Query safety and correctness: Use parameterized queries, handle dynamic IN clauses and sortable columns safely, and distinguish not-found cases from real errors.
- Operational reliability: Close rows, tune connection pools, manage NULL scanning, and structure transactions with proper isolation and locking.
- Use case: Reviewing a repository layer that reads users from PostgreSQL and updating it to use context-aware queries, safe scans, and transaction-safe write logic.
Quick Start
Ask the assistant to review your Go database code for SQL injection risks, missing context usage, row-closing bugs, and transaction safety issues.