What problem does it solve? Go database code is easy to get subtly wrong: leaked connections from unclosed rows, SQL injection from string concatenation, missing context propagation, and race conditions from unlocked reads. This Skill encodes the correct patterns for database/sql, sqlx, and pgx so generated and reviewed code follows safe, explicit database practices. ## Core Features & Use Cases - Safe query patterns: Enforces parameterized queries, context propagation, explicit sql.ErrNoRows handling, and proper rows.Close() / rows.Err() discipline. - Transactions and locking: Covers BeginTxx/defer Rollback/Commit, isolation levels, and SELECT ... FOR UPDATE for read-modify-write flows like fund transfers. - Performance guidance: Connection pool sizing, batch inserts of 100–1000 rows, pgx COPY protocol for bulk loads, and cursor-based pagination instead of OFFSET. - Testing strategies: Mock-based unit tests, sqlmock query verification, and build-tagged integration tests with transaction rollback or testcontainers. - Use Case: When asked to write a TransferFunds function, the Skill produces a serializable transaction that locks rows with SELECT FOR UPDATE, defers rollback, and wraps errors with context. ## Quick Start Ask the agent to write or review a Go function that queries PostgreSQL with sqlx, such as a paginated user listing or a transactional balance transfer.