This talk explores how to bridge sqlc’s type-safe database layer with a clean, domain-driven service architecture using Crush/OpenCode — an open source code generator written in Go.
Sqlc generates strongly typed database access, but using its structs directly can couple business logic to schema details. Crush/OpenCode automates the creation of repository layers that work with domain entities instead, orchestrating transactions while preserving compile-time safety.
Built entirely in Go, Crush/OpenCode uses Ollama and the gpt-oss model for “augmented generation,” guided by reference implementations to keep the produced code consistent and idiomatic. It also generates tests first, using testify/suite, Testcontainers-Go, gofakeit, and go-cmp, then refines repositories until tests pass.
The result is a practical Go-based workflow that reduces boilerplate, ensures consistency across repositories, and demonstrates how open source LLM tooling can enhance real-world Go development — without sacrificing simplicity or type safety.