# sqlc-dev/sqlc

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/sqlc-dev-sqlc).**

16,983 stars · 997 forks · Go · mit

## Links

- GitHub: https://github.com/sqlc-dev/sqlc
- Homepage: https://sqlc.dev
- awesome-repositories: https://awesome-repositories.com/repository/sqlc-dev-sqlc.md

## Topics

`code-generator` `go` `kotlin` `mysql` `orm` `postgresql` `python` `sql` `sqlite`

## Description

sqlc is a code generation tool that compiles raw SQL queries into type-safe application code. By analyzing SQL statements against database schema definitions during the build process, it eliminates the need for manual data mapping and prevents runtime type errors.

The project functions as a schema-aware generator that translates database column types into native language primitives. It distinguishes itself through a modular, plugin-based architecture that allows for the extension of the generation pipeline to support diverse programming languages and custom frameworks beyond its default capabilities.

Beyond basic generation, the tool provides automated validation of SQL queries and schema compatibility, ensuring that database interactions remain consistent with the underlying schema before code is deployed. It also supports the creation of transactional query blocks and strongly-typed update functions to maintain data integrity across application logic.

## Tags

### Data & Databases

- [Type-Safe](https://awesome-repositories.com/f/data-databases/sql-generators/type-safe.md) — Compiles raw SQL queries into type-safe application code to eliminate manual data mapping and runtime errors.
- [Type-Safe Database Clients](https://awesome-repositories.com/f/data-databases/type-safe-database-clients.md) — Generates strongly-typed interfaces for database operations to eliminate manual data mapping and runtime errors. ([source](https://docs.sqlc.dev/howto/query_count.html))
- [Schema Compatibility Validators](https://awesome-repositories.com/f/data-databases/data-processing-pipelines/data-serialization/schema-compatibility-validators.md) — Verifies SQL queries against database schema definitions during the build process to ensure compatibility and prevent deployment failures.
- [Database Automation Tools](https://awesome-repositories.com/f/data-databases/database-automation-tools.md) — Automates the creation of boilerplate-free database interaction code to ensure reliable storage layer communication.
- [Type-Safe Client Generators](https://awesome-repositories.com/f/data-databases/type-safe-client-generators.md) — Creates language-specific code interfaces from SQL queries to prevent runtime type errors. ([source](https://cdn.jsdelivr.net/gh/sqlc-dev/sqlc@main/README.md))
- [SQL Query Execution](https://awesome-repositories.com/f/data-databases/database-management-systems/database-systems-management/database-operations/sql-query-execution.md) — Validates SQL statements against the database schema during compilation to confirm syntax and type compatibility. ([source](https://docs.sqlc.dev/_sources/index.rst.txt))
- [Type Mapping Utilities](https://awesome-repositories.com/f/data-databases/type-mapping-utilities.md) — Translates database column types into native language primitives to ensure type safety in generated code.

### Development Tools & Productivity

- [Schema-Driven Code Generators](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/code-generation/schema-driven-code-generators.md) — Generates idiomatic, type-safe application code by cross-referencing SQL queries against database schema definitions.
- [Code Generation Pipelines](https://awesome-repositories.com/f/development-tools-productivity/code-generation-pipelines.md) — Provides extensible build pipelines to produce specialized database access code for various frameworks.
- [Code Generation](https://awesome-repositories.com/f/development-tools-productivity/project-scaffolding-config-code-generation/code-generation.md) — Enables the addition of custom plugins to the compilation pipeline for specialized code generation. ([source](https://docs.sqlc.dev/guides/plugins.html))

### Web Development

- [SQL Schema Validators](https://awesome-repositories.com/f/web-development/schema-validation/sql-schema-validators.md) — Verifies SQL queries against database schema definitions during the build process to catch breaking changes.

### Software Engineering & Architecture

- [Compile-Time Validators](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/dependency-graph-compilers/compile-time-validators.md) — Verifies SQL query validity against database schema definitions during the build process.
- [Plugin-Based Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures.md) — Provides a modular architecture allowing external plugins to extend the code generation pipeline.

### Programming Languages & Runtimes

- [Code Generators](https://awesome-repositories.com/f/programming-languages-runtimes/compiler-interpreter-internals/code-generators.md) — Provides a modular, plugin-based system to generate specialized, type-safe database access code for various programming languages.
