Generate type-safe code from SQL queries for Go, Kotlin, Python, and TypeScript applications.
sqlc is a SQL compiler that generates type-safe code from SQL queries for multiple programming languages. It solves the problem of runtime SQL errors and manual query building by producing compile-time safe interfaces directly from SQL files. Developers write SQL, and sqlc automatically creates idiomatic, type-safe functions in their application code.
Backend and full-stack developers working with Go, Kotlin, Python, or TypeScript who need type-safe database interactions without the overhead of ORMs. Teams looking to reduce SQL-related bugs and improve developer productivity.
sqlc provides a SQL-first approach with guaranteed type safety, eliminating the need for manual query building and reducing runtime errors. Unlike ORMs, it keeps developers close to SQL while generating idiomatic code, offering better performance and control.
Generate type-safe code from SQL
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates type-safe functions from SQL queries, catching errors during code generation rather than at runtime, as emphasized in the README's focus on compile-time safety.
Supports Go, Kotlin, Python, and TypeScript with an extensible plugin architecture, allowing teams to use their preferred language without sacrificing type safety, per the language support section.
Developers write queries in pure SQL, and sqlc generates idiomatic code, promoting a closer relationship with the database and reducing abstraction overhead, aligning with its philosophy stated in the description.
Identifies SQL syntax errors and type mismatches at code generation time, preventing runtime failures and improving code reliability, as highlighted in the key features.
Requires running sqlc as a separate code generation step in development and CI/CD pipelines, adding complexity compared to integrated ORMs that work at runtime.
Lacks built-in support for common ORM functionalities like schema migrations, relationship handling, or database-agnostic abstractions, necessitating additional tools and manual effort.
May not support all SQL features or database-specific extensions out-of-the-box, requiring developers to write custom code or workarounds for complex or niche queries.