Postgres.js

Languages and libraries

database driver library

SHOW HN2022

Legend

Postgres.js

Fastest Full-Featured PostgreSQL Client for Node and Deno

github.com

#postgresql#node.js#database driver#deno#sql client

257points
83comments
#183of 2,570 in 2022
Top 8%of 2022 by points

How HN took it

MixedNo clear lean

20 positive, 14 neutral or asking, 0 mixed, 4 critical, out of 38 comments about the project. Thread score +0.38.

Design: 8 for, 0 againstExecution: 2 for, 3 againstDocs: 1 for, 1 againstPerformance: 2 for, 0 againstIdea: 1 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Tagged template literal API is great developer experience

    From 3 comments
    • Congrats on the release - as I mentioned on twitter, your templating design is the best DX i've seen for any PG client. > Inspired from Supabase Realtime you can now have it…
      kiwicopple on HN
    • nice!
      rubyist5eva on HN
    • This looks great! I really like the idea of using tagged template literals for queries.
      juhanakristian on HN
  • Fast performance and zero dependencies

    From 2 comments
    • Excellent work as usual, Rasmus! :) Loved my time with postgres.js in past projects, looking forward to checking out v3 in an upcoming project of mine. The speed and lack of any…
      keb_ on HN
    • There is quite a big difference, but I'll highlight some of the main points here. Note I'm the author of Postgres.js so I'm obviously biased. Slonik is a wrapper around another…
      porsager on HN

Objections

  • Performance claims over native pg-native questioned

    From 2 comments
    • How can this be so much faster than even pg-native that uses the C library libpq? https://github.com/porsager/postgres-benchmarks#results
      pier25 on HN
    • On the surface I'm not sure this explanation passes the smell test. Almost irrespective of how you get the data from your network card into v8 / nodejs, you're going to be…
      w1nk on HN
  • Missing binary protocol support for bytea

    From 2 comments
    • Is raw using binary protocol? (for ex: send\receive UInt8Array Buffer without converting to hex string for bytea column)
      starsol on HN
    • No, that unfortunately didn't make it into this release. I want to add that in a future update, first at least for bytea, but then also for other types that benefit from it.
      porsager on HN

Requests

  • Knex support

    From 2 comments
    • Thanks porsager. Any plans for Knex support?
      ruffrey on HN
    • Yeah, I think it could make sense for performance reasons to make a version for Knex, but since I try to stay away from ORMs as much as possible I'm probably not the right one to…
      porsager on HN
  • Expose rows as arrays

    From 2 comments
    • What a coincidence seeing this on HN. Great lib! I actually experimented with replacing our use of node-postgres with this today. Your lib was the reason I finally got around to…
      somebee on HN
    • Thanks a lot! What a coincidence - and perfect timing since v3 supports .raw()[1] to receive results as arrays. I'd also be very curious to hear how replacing pg goes :) And also…
      porsager on HN

Questions

  • How it compares to slonik

    From 3 comments
    • I’m curious, how does this project compare to slonik that is also a fast, lightweight, full featured, using SQL template literals etc ? Is there any reason to consider switching,…
      elnygren on HN
    • Looks good from what I see. How does this compare with slonik? Also what do the error messages look like?
      throwthere on HN
    • There is quite a big difference, but I'll highlight some of the main points here. Note I'm the author of Postgres.js so I'm obviously biased. Slonik is a wrapper around another…
      porsager on HN
  • Whether it is built in TypeScript

    From 2 comments
    • Super cool, looks great. Interesting to see you built it with Typescript. I was wondering-- and I know this is a long story, but I am curious: How does one go about building a…
      twomoonsbysurf on HN
    • Thanks a lot. I did not built it with Typescript, just plain js - I don't use Typescript at all(not my cup of tee), but a kind soul (thanks @minigugus) contributed the typings ;)…
      porsager on HN

Alternatives named

  • pg (node-postgres)

    From 2 comments
    • Thanks - that's really nice to hear! That would be really interesting. Are you using `pg` currently, and are you using WebSocket connections in Node to Elixir for realtime, or…
      porsager on HN
    • yes, we use `pg` in all our Node servers (and no realtime)
      kiwicopple on HN
  • Slonik

    From 2 comments
    • I’m curious, how does this project compare to slonik that is also a fast, lightweight, full featured, using SQL template literals etc ? Is there any reason to consider switching,…
      elnygren on HN
    • There is quite a big difference, but I'll highlight some of the main points here. Note I'm the author of Postgres.js so I'm obviously biased. Slonik is a wrapper around another…
      porsager on HN
  • pg-native

    From 1 comment
    • How can this be so much faster than even pg-native that uses the C library libpq? https://github.com/porsager/postgres-benchmarks#results
      pier25 on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/30794332)