# sqlc-dev/sqlc

Generate type-safe code from SQL

Repository: https://github.com/sqlc-dev/sqlc
Canonical: https://ross.abutalabs.com/products/sqlc
Homepage: https://sqlc.dev
Language: Go
License: MIT
License Family: permissive
Topics: go, postgresql, sql, orm, code-generator, mysql, python, kotlin, sqlite
Last push: 2026-08-26T21:46:10+00:00

## Health v2 (maintenance only)
Score: 84/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 56, longevity 100
- inputs: {"age_days": 2630, "days_push": 7, "days_rel": 133, "gap_med": 111.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 18202, forks 1081 (observed 2026-08-28T04:11:26.442780+00:00)

## What it is
sqlc is a command-line SQL compiler that generates fully type-safe, idiomatic code from SQL queries for languages like Go, Kotlin, Python, and TypeScript. You write plain SQL, and sqlc produces type-safe interfaces to those queries, eliminating boilerplate database access code.

## Use cases
- generate type-safe database code from sql queries
- replace orm boilerplate with plain sql
- generate go code from postgresql queries
- catch sql type errors at compile time
- generate kotlin or python database clients from sql
- lint and verify sql queries in ci

## When to choose
- you prefer writing raw SQL over ORM query builders
- you want compile-time type safety for database queries
- you use PostgreSQL, MySQL, or SQLite with Go, Kotlin, Python, or TypeScript
- you want to eliminate hand-written database access boilerplate

## When to avoid
- you need dynamic queries built at runtime
- you want a full ORM with relationships, migrations, and change tracking
- your target language or database is unsupported

## Facets
- artifact type: cli-tool
- maturity: stable
- function: database, orm, parser, cli, developer-tools
- domain: databases, developer-tools, backend, apis
- platform: windows, go, cli, cross-platform
- tags: sql, type-safety, code-generation, postgresql, mysql, sqlite, query-builder, code-generator, linux, macos

## Member repositories
- sqlc-dev/sqlc (main) score 84

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:11:26.442780+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:02:07.224242+00:00, confidence not recorded.
  - readme: https://github.com/sqlc-dev/sqlc (fetched 2026-08-28T04:11:26.442780+00:00, sha ab348962d4e1)
  - homepage: https://sqlc.dev (fetched 2026-08-29T08:00:05.298975+00:00, sha 231d749ea507)
  - site_page: https://docs.sqlc.dev (fetched 2026-08-29T08:00:05.308311+00:00, sha eef7a87fff83)
  - site_page: https://docs.sqlc.dev/en/stable/reference/changelog.html (fetched 2026-08-29T08:00:05.310374+00:00, sha e820fb4ce14b)
  - site_page: https://docs.sqlc.dev/en/latest/reference/changelog.html (fetched 2026-08-29T08:00:05.314034+00:00, sha 46b945069d1e)
- Data as of 2026-08-30T08:39:29.467469+00:00.
