What problem does it solve?
This Skill addresses the challenge of writing boilerplate repository code in Go, which is often repetitive, error-prone, and lacks compile-time safety when interacting with SQL databases. It aims to provide a robust, type-safe data access layer without the overhead of an ORM.
Core Features & Use Cases
- SQL Schema to Repository: Generates a complete repository layer directly from your SQL schema definitions.
- Type Safety: Ensures compile-time checks for all database interactions, reducing runtime errors.
- Includes:
sqlc.yaml configuration, SQL query files, a repository interface, a concrete pgx implementation, and a testify mock for testing.
- Use Case: When starting a new Go microservice that requires database interaction, use this skill to quickly scaffold a production-ready, type-safe repository layer, allowing developers to focus on business logic rather than data access plumbing.
Quick Start
Use the go-sqlc-repo skill to generate a repository for a 'users' table from the provided SQL schema.