A practical walkthrough of building a Go REST API using three focused tools: Huma for HTTP handling and automatic OpenAPI spec generation, sqlc for type-safe database query generation from plain SQL, and Goose for SQL-based schema migrations. The stack avoids ORMs and runtime reflection by keeping SQL explicit and generating Go code from it. The post covers project layout, migration setup, query writing, Huma input/output type definitions with built-in validation, wiring everything together in main.go, and a Makefile for consistent team workflows. The author argues this combination offers enough structure for team productivity without hiding important logic behind framework magic.
Table of contents
Project LayoutMigrations with GooseQueries with sqlcHTTP Operations with HumaWiring It TogetherThe OpenAPI SpecThe MakefileWhy This Stack1 Impression