sqlc is a code generator that produces type-safe code from SQL queries.
The tool solves the problem of maintaining consistency between SQL queries and application code by parsing your SQL and generating strongly-typed interfaces in your target language. You write queries in SQL, run sqlc to generate code with type-safe methods for those queries, then call the generated code from your application. This approach eliminates the manual work of writing database access layers and catches type mismatches at code generation time rather than at runtime.
The tool supports Go, Kotlin, Python, and TypeScript, with additional languages available through a plugin system. It works with PostgreSQL, MySQL, and SQLite. Choose sqlc if you want to keep your database logic in SQL while gaining the safety guarantees of generated code, and if you prefer this approach to writing an ORM or hand-coding database access layers. The project is well-suited to teams that value explicit SQL over abstraction layers and want compile-time verification of query correctness.
Almost all open issues are raised by outside users rather than the core team, indicating a substantial base of adopters reporting real-world use. A first response to an issue or pull request typically takes one to two weeks. Work in the issue tracker is dominated by bug reports and issues related to Go and PostgreSQL support.