sqlc is a tool that automatically generates code from SQL queries, saving developers from writing repetitive database-access code by hand. SQL (Structured Query Language) is the standard way to talk to databases, it lets you say things like "give me all users created this month." The problem is that connecting SQL to application code usually means writing a lot of boilerplate (repetitive, boring code) that is easy to get wrong. sqlc works in three steps: you write your SQL queries in plain SQL files, you run the sqlc tool, and it generates clean code in your chosen language with type-safe interfaces. "Type-safe" means the generated code knows exactly what kind of data each query returns or expects, so mistakes like passing a number where text is expected get caught before your app even runs, rather than crashing in production. You then write your application logic calling that generated code instead of writing raw database calls yourself. This keeps your code clean, predictable, and much easier to maintain. It is especially useful when you want the reliability of hand-written SQL (full control over your queries, no hidden performance surprises) combined with the safety net of generated code. It supports Go, Kotlin, Python, and TypeScript as output languages, and works with PostgreSQL and MySQL databases. Additional languages can be added via plugins. sqlc is written in Go and has over 17,000 GitHub stars, indicating broad community adoption among backend developers.
Generated 2026-05-21 · Model: sonnet-4-6 · Verify against the repo before relying on details.