Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
1–10 of 87 posts
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#21. Realtime subscribe to changes through Logical Replication [2]
It's now possible to use logical replication to subscribe in realtime to any changes in your database with a simple api like `sql.subscribe('insert:events', row => ...)`. Inspired from Supabase Realtime you can now have it yourself in Node.
2. A Safe Dynamic Query Builder
Nesting the sql`` tagged template literal function allows building highly dynamic queries while staying safe and using parameterized queries at the same time.
3. Multi-host connection URLs for High Availability support
It's really nice to be able to quickly spin up a High Availability Postgres setup using pg_auto_failover[3] and connect using Postgres.js with automatic failover and almost 0 downtime.
4. Deno support
It also works with Deno now, completing all tests except a few SSL specific ones which requires fixes in Deno.
5. And much more
Large object support, efficient connection handling for large scale use, cancellation of requests, Typescript suport, async cursors.
[1] https://github.com/porsager/postgres-benchmarks#results
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#3Hi everyone. A bit more than two years ago I released the first version of Postgres.js. A fully featured PostgreSQL driver for Node.js written as a learning experience out of curiosity and annoyance with the current options. It greatly outperformed the alternatives[1] using pipelining and prepared statements, while providing a much better development experience safe from SQL injections. Since then I've been busy buil…
> Inspired from Supabase Realtime you can now have it yourself in Node.
Very cool! We have some Node servers internally, I'll see if the team want to switch.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#4Hi everyone. A bit more than two years ago I released the first version of Postgres.js. A fully featured PostgreSQL driver for Node.js written as a learning experience out of curiosity and annoyance with the current options. It greatly outperformed the alternatives[1] using pipelining and prepared statements, while providing a much better development experience safe from SQL injections. Since then I've been busy buil…
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 yourself in Node. Very cool! We have some Node servers internally, I'll see if the team want to switch.
That would be really interesting. Are you using `pg` currently, and are you using WebSocket connections in Node to Elixir for realtime, or not using realtime in Node?
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#5Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#6Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#7What 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 shipping support for tagged template literals in Imba today ( https://github.com/imba/imba/commit/ae8c329d1bb72eec6720108d... ) :) Are you open for a PR exposing the option to return rows as arrays? It's pretty crucial for queries joining mul…
I'd also be very curious to hear how replacing pg goes :)
And also good job on Imba! I'm a really big fan of stripping syntax down to the bare essentials, and what you've done with Imba is really impressive!
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#8Earlier quoted context omitted.
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 yourself in Node. Very cool! We have some Node servers internally, I'll see if the team want to switch.
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 not using realtime in Node?
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#9Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#10Do template literals like this in JS work differently than just straight up string interpolation? As a rails dev this set off alarm bells.