Developer tools · sql query builder
sqlc
Hacker Approved
Generates type-safe code from plain SQL queries, giving ORM-style convenience without ORM overhead. Critics say support for other languages lags behind Go and Postgres.
Summarized from 27 comments.
Generates type-safe code from plain SQL queries, giving ORM-style convenience without ORM overhead. Critics say support for other languages lags behind Go and Postgres.
- recommend
- 20
- criticize
- 4
- months recommended
- 9 of 13
Why people love it
Type-safe code generated from SQL · 5
It made most of the boilerplate of using plain SQL go away, I get type safe responses
Feb 2026 · commentso I never have any issues with SQL being wrong or out of sync with the data model
Apr 2026 · commentit produces models and repositories based on plain sql queries
Jun 2026 · commentAvoids ORM mechanisms and overhead · 3
you avoid the many awkward mechanisms ORMs need to integrate SQLisms into the native language
Nov 2025 · commentbetter tools like sqlc etc that have orm ergonomics without the performance hit
Nov 2025 · commentcover most of the perceived advantages of ORMs, without the downsides
Feb 2026 · commentRemoves boilerplate from plain SQL · 2
It made most of the boilerplate of using plain SQL go away, I get type safe responses
Feb 2026 · commentit produces models and repositories based on plain sql queries
Jun 2026 · commentFlexible, you write exact queries · 2
Writing queries in sql and then generating for the target language also provides a flexibility that has reduced rewrite cost.
Jun 2026 · commentYou specify just what you want from the database, without needing to couple so much API with database tables.
Mar 2026 · comment
What people warn about
Weaker support for languages beyond Go · 2
I love sqlc, but I think it's more fair to say it's an SQL code generator for Postgres and Go.
Jun 2026 · commentsupport for other languages is not as great
Jun 2026 · commentQuery placement and naming is cumbersome · 2
it is a little cumbersome to add them to a different file and find a name for them
Feb 2026 · commentI don’t recall sqlc giving any solution to help with this.
Jul 2026 · comment
What hackers pick instead
- Ecto (Elixir)Elixir database library that follows SQL closely, makes queries explicit and avoids hidden magic. Main caveat: defining large schemas is repetitive compared with Django.17recommend
- sqlxRust crate that checks SQL against your database at compile time, catching type errors early. Common caveat: dynamic queries are hard.13recommend
- jOOQPraised for type-safe SQL in Java without ORM magic; some critics call it weaker than alternatives.13recommend
- KyselyPeople recommend Kysely for type-safe query building with rich TypeScript support while keeping close to raw SQL. One critic says complicated queries fall apart.12recommend
- JdbiPeople recommend Jdbi as a Java database library that handles connection plumbing while leaving the SQL visible, with no ORM layer in between.6recommend
Every quote
The 22 most detailed of 27 comments. Each links to the original.
Writing queries in sql and then generating for the target language also provides a flexibility that has reduced rewrite cost.
Recommends · Jun 2026 · in “Are you expected to run five Python type-checkers now?”
You specify just what you want from the database, without needing to couple so much API with database tables.
Recommends · Mar 2026 · in “Show HN: Oxyde – Pydantic-native async ORM with a Rust core”
I love sqlc, but I think it's more fair to say it's an SQL code generator for Postgres and Go.
Mixed · Jun 2026 · in “Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM”
you avoid the many awkward mechanisms ORMs need to integrate SQLisms into the native language
Mixed · Nov 2025 · in “Blending SQL and Python with Sqlorm”
It made most of the boilerplate of using plain SQL go away, I get type safe responses
Recommends · Feb 2026 · in “Postgres Is Your Friend. ORM Is Not”
so I never have any issues with SQL being wrong or out of sync with the data model
Recommends · Apr 2026 · in “I run multiple $10K MRR companies on a $20/month tech stack”
better tools like sqlc etc that have orm ergonomics without the performance hit
Recommends · Nov 2025 · in “Reddit Migrates Comment Back End from Python to Go”
cover most of the perceived advantages of ORMs, without the downsides
Recommends · Feb 2026 · in “Postgres Is Your Friend. ORM Is Not”
it produces models and repositories based on plain sql queries
Recommends · Jun 2026 · in “Learn SQL Once, Use It for 30 Years”
type safety + auto repo layer from your query.sql
Recommends · Jun 2026 · in “How's Linear so fast? A technical breakdown”
sqlc for type-safe code generated from SQL
Recommends · Jul 2026 · in “How I use HTMX with Go”
it is a little cumbersome to add them to a different file and find a name for them
Criticizes · Feb 2026 · in “Show HN: Pg-typesafe – Strongly typed queries for PostgreSQL and TypeScript”
I don’t recall sqlc giving any solution to help with this.
Criticizes · Jul 2026 · in “How I use HTMX with Go”
support for other languages is not as great
Criticizes · Jun 2026 · in “Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM”
they are both there for you for your highs (select * from table order by created at) and your lows
Recommends · Jul 2026 · in “What ORMs have taught me: just learn SQL (2014)”
which can generate a lot of your "dynamic DB magic" without actually being a real dependency
Recommends · May 2026 · in “Migrating from Go to Rust”
Sqlc is a hope for me. It is almost like treating your DB as an RPC.
Recommends · Nov 2025
sqlc is pretty darn great but it's no comparison to Django
Recommends · May 2026 · in “Just Fucking Use Go”
Sqlc works great with Postgres or Sqlite
Recommends · May 2026 · in “Show HN: Building a web server in assembly to give my life (a lack of) meaning”
a more mature solution in this space
Recommends · Jun 2026 · in “Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM”
does this for me. Its been nice!
Recommends · Aug 2026 · in “Rethinking Database Programming”
SQLC does not address most of the perceived advantages to ORMs
Criticizes · Feb 2026 · in “Postgres Is Your Friend. ORM Is Not”
Counts from 1,795,640 Hacker News comments, Nov 2025 to Nov 2026. How we count · Report a mistake