Skip to main content

Extending sqlc: augmented generation of repositories in Go

UB5.132 | Day 2 | 15:00 - 15:30 | Speakers: Nikolay Kuznetsov

Extending sqlc: augmented generation of repositories in Go
A picture of a devroom at FOSDEM 2024
Open in browser

Notes

Abstract

This talk explores how to bridge sqlc (SQL-compiler)'s type-safe generated queries with a clean service architecture using Crush coding agent. It is open source and built entirely in Go.

Sqlc generates strongly typed database access, but using its structs directly can couple business logic to schema details. Crush can automate the creation of repository layer on top of sqlc-generated artifacts. Repositories work with domain entities, orchestrate transactions while preserving compile-time type safety.

In this talk, Crush leverages augmented generation (reference implementation + custom command or skills) 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 code 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.


Notice: The placeholder video image is licensed under CC BY-SA 4.0. The original image can be found hereChanges made to the image are: Cropped the image to a new ratio, part of the image was cut off.