sqlc: Write SQL, Skip the Boilerplate
AI coding assistants are great at generating boilerplate. But for database code in Go, there is a better option: one that generates it from your SQL itself, with zero hallucination risk. It is called sqlc . What sqlc does You give it your SQL query files and your schema. It generates type-safe Go functions. Setup is a single config file: # sqlc.yaml sql: - engine: "postgresql" queries: "db/queries" schema: "db/models" gen: go: package: "repo" sql_package: "pgx/v5" out: "db/repo" Point it at your queries, point it at your schema, run sqlc generate....