Hacker ApprovedDepartments

sqlx

Hacker Approved

Shares rank 3 of 8 SQL query builders by recommenders

Rust crate that checks SQL against your database at compile time, catching type errors early. Common caveat: dynamic queries are hard.

Rust crate that checks SQL against your database at compile time, catching type errors early. Common caveat: dynamic queries are hard.

17 people gave an opinion

recommend it
13
criticize it
4
approval share
76%
Each figure is one person. RecommendsCriticizes

Recommended in 8 of 13 months

  1. November 2025: recommended
  2. December 2025: not recommended
  3. January 2026: not recommended
  4. February 2026: recommended
  5. March 2026: recommended
  6. April 2026: recommended
  7. May 2026: not recommended
  8. June 2026: recommended
  9. July 2026: recommended
  10. August 2026: recommended
  11. September 2026: recommended
  12. October 2026: not recommended
  13. November 2026: not recommended (month in progress)

Why it carries the badge

  • 13 people recommend itNeeds 10 or more, met.
  • 3.3 recommenders for every criticNeeds 2 to 1 or better, met.
  • Recommended in 8 of 13 monthsNeeds 4 or more, met.

The same three rules apply to every product, and the badge can’t be bought. How the badge works

What people say about it

The reasons people give, with the number of comments that give each one. Open a reason to read what they said.

Why people recommend it

Each mark is one comment

  • Compile-time SQL and type checks

    “getting a compile time error when SELECT query params or return values have type mismatches is extremely nice”

    Comment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

    “it statically analyses the SQL in your program against the database and ensures the SQL is valid”

    Comment from 11 Jul 2026 in “Scarf has moved away from Haskell”
  • Works well with Postgres

    “I've been using sqlx + postgres very successfully with claude in the last couple of months.”

    Comment from 20 Mar 2026 in “Java Is Fast. Your Code Might Not Be”

    “SQLX with Postgres is my go to.”

    Comment from 13 Nov 2025 in “Building Rust Web Apps”
  • Inspired other SQL libraries

    “That's actually the library that inspired me the most for building bun-sqlgen”

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

    “I actually took a lot of inspiration from sqlx, which is really nice.”

    Comment from 23 Jun 2026 in “Show HN: Bun-sqlgen – Type-safe raw SQL for Bun, no ORM”
  • Safe design, natural fit in Rust

    “sqlx's design choice to make dynamic queries hard is a logical choice from a safety standpoint”

    Comment from 19 Feb 2026 in “Farewell Rust”

    “SQLx, which is a natural fit in Rust because of how Rust macros work”

    Comment from 11 Jul 2026 in “Scarf has moved away from Haskell”

What people warn about

Each mark is one comment

  • Dynamic queries are hard to build

    “Whereas with sqlx you end up writing Rust that generates SQL strings, ie re-inventing query builders.”

    Comment from 19 Feb 2026 in “Farewell Rust”

    “Your building a string and tracking binds. It gets messy.”

    Comment from 19 Feb 2026 in “Farewell Rust”
  • Offline mode is opt-in

    “sqlx offline mode being opt-in instead of default is what bothers me”

    Comment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

    “I also wish that it would be the default.”

    Comment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”
  • Occasional bugs and rough edges

    “switch a project from some raw sqlx jank to Diesel”

    Comment from 18 Jul 2026 in “Topcoat: The full full-stack framework for Rust”

    “There's just a sqlx bug in 0.9.”

    Comment from 4 Jun 2026 in “Corporate America Is Starting to Ration AI as Cost Skyrockets”

Other SQL query builders people recommend

The four most recommended other SQL query builders, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.

sqlx compared with 4 alternatives
ProductRecommendCriticizeApprovalMonthsOwnedBadge
sqlc20483%9—Approved
Ecto (Elixir)17577%8—Approved
sqlxThis page13476%8—Approved
jOOQ13381%6—Approved
Kysely12192%6—Approved
See all 8 SQL query builders, ranked

What people said

19 of the 21 comments that mention it, newest first. Each links to the original comment.

“SQLx is much closer to my cup of tea than Toasty.”

RecommendsComment from 25 Sep 2026 in “Topcoat is pushing the boundary of server applications with Rust”

“I also wish that it would be the default.”

CriticizesComment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“sqlx offline mode being opt-in instead of default is what bothers me”

MixedComment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“getting a compile time error when SELECT query params or return values have type mismatches is extremely nice”

RecommendsComment from 20 Aug 2026 in “Malicious Rust Crate Arrayref Runs a Build-Time Payload”

“You’d have a better chance of getting your PR accepted into”

RecommendsComment from 1 Aug 2026 in “Golang proposal: container/: generic collection types”

“switch a project from some raw sqlx jank to Diesel”

CriticizesComment from 18 Jul 2026 in “Topcoat: The full full-stack framework for Rust”

“it statically analyses the SQL in your program against the database and ensures the SQL is valid”

RecommendsComment from 11 Jul 2026 in “Scarf has moved away from Haskell”

“SQLx, which is a natural fit in Rust because of how Rust macros work”

RecommendsComment from 11 Jul 2026 in “Scarf has moved away from Haskell”

“I find rust's sqlx or java's jooq to be hitting the sweet spot”

RecommendsComment from 4 Jul 2026 in “What ORMs have taught me: just learn SQL (2014)”

“That's actually the library that inspired me the most for building bun-sqlgen”

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

“I actually took a lot of inspiration from sqlx, which is really nice.”

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

“There's just a sqlx bug in 0.9.”

CriticizesComment from 4 Jun 2026 in “Corporate America Is Starting to Ration AI as Cost Skyrockets”

“If you haven't tried writing a simple web service in Axum or Actix plus SQLx, you need to give it a try.”

RecommendsComment from 1 Apr 2026 in “EmDash – a spiritual successor to WordPress that solves plugin security”

“I've been using sqlx + postgres very successfully with claude in the last couple of months.”

RecommendsComment from 20 Mar 2026 in “Java Is Fast. Your Code Might Not Be”

“ended up settling on `sqlx` + hand-written SQL”

RecommendsComment from 20 Feb 2026 in “Farewell Rust”

“Your building a string and tracking binds. It gets messy.”

CriticizesComment from 19 Feb 2026 in “Farewell Rust”

“sqlx's design choice to make dynamic queries hard is a logical choice from a safety standpoint”

RecommendsComment from 19 Feb 2026 in “Farewell Rust”

“Whereas with sqlx you end up writing Rust that generates SQL strings, ie re-inventing query builders.”

MixedComment from 19 Feb 2026 in “Farewell Rust”

“SQLX with Postgres is my go to.”

RecommendsComment from 13 Nov 2025 in “Building Rust Web Apps”

Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.