Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
Hi 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 building things using it, now running in production, and although quite delayed I'm so happy to release a new major today with some really exciting new features:<p>1. Realtime subscribe to changes through Logical Replication [2]<p>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.<p>2. A Safe Dynamic Query Builder<p>Nesting the sql`` tagged template literal function allows building highly dynamic queries while staying safe and using parameterized queries at the same time.<p>3. Multi-host connection URLs for High Availability support<p>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.<p>4. Deno support<p>It also works with Deno now, completing all tests except a few SSL specific ones which requires fixes in Deno.<p>5. And much more<p>Large object support, efficient connection handling for large scale use, cancellation of requests, Typescript suport, async cursors.<p>[1] <a href="https://github.com/porsager/postgres-benchmarks#results" rel="nofollow">https://github.com/porsager/postgres-benchmarks#results</a><p>[2] <a href="https://github.com/porsager/postgres#realtime-subscribe" rel="nofollow">https://github.com/porsager/postgres#realtime-subscribe</a><p>[3] <a href="https://github.com/citusdata/pg_auto_failover" rel="nofollow">https://github.com/citusdata/pg_auto_failover</a>