Abstract
Using sqlc in Go is great for generating type-safe database access — but using its generated models / records directly in your service layer ties your domain to the database structure. To keep things flexible, a repository layer is still needed to handle mapping and transactions — but writing that by hand gets repetitive fast.
In this talk, I’ll show how I built a custom Go generator that uses AI to create repositories and integration tests on top of sqlc, based on reference implementation I provide. Unlike Copilot Chat, there’s no copy-pasting or re-explaining — the tool understands the structure I want and generates consistent code automatically.
This makes it easy to bootstrap a new project: define your SQL schema, write your queries, repository interface, run sqlc, and let the generator build the repository implementation and integration tests for it.