Work in progress: 181,232 of 181,233 sites checked so far, more every week · updated 2 Nov 2026Missing a blog? Tell us

Top all-time · #11397

G

Gajus Kuizinas

Personal blog · gajus.medium.comprogrammingdata

Gajus Kuizinas's personal blog at gajus.medium.com covers programming and data. Since 2021, 7 different Hacker News readers have linked it 18 times, most often “Stop Using Query Builders (2019)”. It is still writing: the last post was on 2026-06-19, and you can follow it by feed.

Visit the blog
18mentions?
7HN people?
2021–2026first – last linked?
Links on Hacker News per year · peak 6 in 2021

Too few sampled comments (1) to say how often HN recommends it.?

Why HN links it

Linked posts are about SQL query builders versus raw SQL, as in a thread on adding OR logic. The one comment argues query builders are an antipattern but does not judge the writing itself.

Summarised by Claude from a sample of 1 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.

Most-linked posts?

  1. Stop Using Query Builders (2019)
    3 people · 14 mentions · first linked 2021-03-10

What Hacker News says?

  1. There are much better solutions than ORMs that let you use native SQL but guarantee that you can't have SQL injections. This blog post, https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41... , is by the author of Slonik, of which I'm a huge fan. It takes advantage of tagged template literals in Javascript to make it feel like you're just concatenating strings, but actually you are creating prepared statemen…

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “I don't want to learn your query language (2018)”
  2. Submitted CTO vs. Head of Engineer as a story · 3 points

    HN discussion
  3. > Any plans for Knex support? That question doesn't really make sense. I'm not familiar with this library, but the developer interface is very similar to slonik. The whole point of this is that SQL tagged template literals replace the need for a query builder like Knex. Here is a good blog post from the author of slonik explaining: https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41...

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno”
  4. Submitted Processing large volumes of data safely and fast using Node.js and PostgreSQL as a story · 3 points

    HN discussion
  5. You're being downvoted, but I completely agree. If you are on Node and Postgres I highly recommend using slonik - it makes it easy to just write SQL but at the same time makes it almost impossible to have mistakes like SQL injections: https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41... https://github.com/gajus/slonik

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “DenoDB”
  6. Submitted Lessons learned scaling PostgreSQL database to 1.2B records/month (2019) as a story · 1 points

    HN discussion
  7. There was an essay a couple years ago that really convinced me to not use query builders, https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41... , and from that I switched to using Slonik (by the author of that blog post). There were some growing pains as the API was updated over the years, especially to support strong typing in the response, but now the API is quite stable and I love that project.

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “You probably don't need query builders”
  8. Submitted Stop Using Query Builders (2019) as a story · 1 points

    HN discussion
  9. The author of slonik, a great (IMO) tool for composing queries in raw SQL in Node for Postgres, has a good blog post explaining this same general idea: https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41... The way I've always put it is "ORMs make the easy stuff a bit easier, and the harder stuff way harder." Just learn SQL, it's not that hard and it's a much better, transferable skill.

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Show HN: Node.js ORM to query SQL database through an array-like API”
  10. Submitted Parsing anything in JavaScript using Earley algorithm as a story · 1 points

    HN discussion
  11. I've been a huge fan of Slonik, https://github.com/gajus/slonik , which makes it easy and safe to write direct SQL queries. The author of Slonik had a good article about the downsides of query builders, previously discussed on HN, that I totally agree with: https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41...

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Our journey in dropping the ORM in Go”
  12. Query builders are still an antipattern (what we traditionally think of when we say query builders) because they are still a DSL that (1) you have to learn along with SQL and (2) never map cleanly to actual SQL, so you always have to resort to `.raw` calls when you need anything more complex than a simple SELECT+JOIN. Even for simple SELECTs, I lost count of how many times I had to enable runtime DEBUG logging in my…

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Adding OR logic forced us to confront why users preferred raw SQL”
  13. You're being downvoted, but I completely agree. In the long run I believe most ORMs end up being a time sink. I like to put it that "they make the easy thing easy, and they make the hard stuff much harder". There are tons of operational benefits to using raw SQL. The author of the slonik library for Postgres wrote this a couple years ago (note the slonik library also makes it trivial to write composable SQL statemen…

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Writing Composable SQL Using Knex and Pipelines”
  14. 100%. I've come to believe that essentially every software engineer, if they write software long enough, comes to despise ORMs. As I always say "They make the easy stuff a little easier, and they make the harder stuff way harder". I have yet to see an ORM actually save me time in the long run; most of the time it just feels like I'm battling it. SQL definitely has its warts, but I don't feel like ORMs make it possib…

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Serious flaws in SQL (1990)”
  15. Couldn't agree with this more. The way I like to put it is "ORMs make the easy parts slightly easier, but they make the hard parts really hard". But I don't care that much about improving the easy parts, because they're already easy! Yet I can remember plenty of times when ORMs made my job a million times more difficult and all I was doing was fighting with the ORM itself (and usually at the worst time, e.g. when a…

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Is ORM still an anti-pattern?”
  16. I think this is a really cool project, but for most use cases (not all, but most) I strongly believe query builders are an anti-pattern. I could go over the reasons, but when I saw this blog post, https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41... , from the author of slonik years ago I had a eureka moment, and it explains the reasoning better than I could. Template strings in TypeScript allow you to sa…

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Kysely: TypeScript SQL Query Builder”
  17. Glad to see this posted. I totally agree - I think Kysely is a cool project but I do think query builders ARE generally an anti-pattern. I'm a huge fan of slonik, https://github.com/gajus/slonik#readme , which uses template strings for SQL and has recently come a long way with its strong typing support. This blog post by the author of slonik outlines why he thinks query builders are anti-pattern, https://gajus.mediu…

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “Kysely: TypeScript SQL Query Builder”
  18. Knex has its own set of problems. Again, SQL is a very powerful, well-known language and there are simpler tools that make it possible to break up and reuse queries. Years ago I was working on a project that used knex, then I serendipitously discovered slonik through this blog post, https://gajus.medium.com/stop-using-knex-js-and-earn-30-bf41... (slonik has subsequently had lots of development since then). I decided…

    Comment linking /stop-using-knex-js-and-earn-30-bf410349856c

    on “What ORMs have taught me: just learn SQL (2014)”

Search all of HN for gajus.medium.com