Skip to content

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 · comment

    so I never have any issues with SQL being wrong or out of sync with the data model

    Apr 2026 · comment

    it produces models and repositories based on plain sql queries

    Jun 2026 · comment
  • Avoids ORM mechanisms and overhead · 3

    you avoid the many awkward mechanisms ORMs need to integrate SQLisms into the native language

    Nov 2025 · comment

    better tools like sqlc etc that have orm ergonomics without the performance hit

    Nov 2025 · comment

    cover most of the perceived advantages of ORMs, without the downsides

    Feb 2026 · comment
  • Removes boilerplate from plain SQL · 2

    It made most of the boilerplate of using plain SQL go away, I get type safe responses

    Feb 2026 · comment

    it produces models and repositories based on plain sql queries

    Jun 2026 · comment
  • Flexible, 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 · comment

    You 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 · comment

    support for other languages is not as great

    Jun 2026 · comment
  • Query 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 · comment

    I don’t recall sqlc giving any solution to help with this.

    Jul 2026 · comment

What hackers pick instead

Every quote

The 22 most detailed of 27 comments. Each links to the original.

  1. 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?”

  2. 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”

  3. 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”

  4. 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”

  5. 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”

  6. 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”

  7. 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”

  8. cover most of the perceived advantages of ORMs, without the downsides

    Recommends · Feb 2026 · in “Postgres Is Your Friend. ORM Is Not”

  9. it produces models and repositories based on plain sql queries

    Recommends · Jun 2026 · in “Learn SQL Once, Use It for 30 Years”

  10. type safety + auto repo layer from your query.sql

    Recommends · Jun 2026 · in “How's Linear so fast? A technical breakdown”

  11. sqlc for type-safe code generated from SQL

    Recommends · Jul 2026 · in “How I use HTMX with Go”

  12. 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”

  13. I don’t recall sqlc giving any solution to help with this.

    Criticizes · Jul 2026 · in “How I use HTMX with Go”

  14. support for other languages is not as great

    Criticizes · Jun 2026 · in “Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM”

  15. 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)”

  16. 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”

  17. Sqlc is a hope for me. It is almost like treating your DB as an RPC.

    Recommends · Nov 2025

  18. sqlc is pretty darn great but it's no comparison to Django

    Recommends · May 2026 · in “Just Fucking Use Go”

  19. 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”

  20. a more mature solution in this space

    Recommends · Jun 2026 · in “Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM”

  21. does this for me. Its been nice!

    Recommends · Aug 2026 · in “Rethinking Database Programming”

  22. 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