Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
31–40 of 87 posts
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#32Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#33Thanks porsager. 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...
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#34 33.6 kB Minified
12.5 kB Minified + GzippedRe: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#35I’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, for example?
Slonik is a wrapper around another node driver (pg), so it's performance is the same as that, where Postgres.js is significantly faster (2-5x)[1].
Postgres.js is also a zero dependency module, whereas Slonik has quite the dependency graph meaning - compare https://npmgraph.js.org/?q=slonik with https://npmgraph.js.org/?q=postgres. That makes it more difficult to audit the code and preventing chain attacks etc.
Slonik also doesn't have the same lean straight forward developer experience as Postgres.js - again I'm biased saying that ;)
Postgres.js also does things that will make your queries perform better out of the box by implicitly creating prepared statements and using pipelining.
I suppose you could build Slonik on top of Postgres.js instead of pg as well, but that would probably only make sense if migrating to Postgres.js.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#36Here is the bundlephobia of this: https://bundlephobia.com/package/postgres@3.0.0 33.6 kB Minified 12.5 kB Minified + Gzipped
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#37Earlier quoted context omitted.
Thanks. Definitely production ready, and I've been using it for quite a while in production myself, towards this release. About the ORM layer I wouldn't know, since I much prefer to avoid that at any cost.
Ok, I'd have to double check to see if the Unlicense is ok for work projects, but this is a great contribution to the node ecosystem.
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#38Thanks porsager. Any plans for Knex support?
> 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...
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#39Thanks porsager. Any plans for Knex support?
I also wouldn't put it in the core library anyway, so it should be straight forward for someone else to make a knex-postgres package that does this?
Re: Show HN: Postgres.js – Fastest Full-Featured PostgreSQL Client for Node and Deno
#40Even transpilation from ES modules into commonjs is done by the author himself:
https://github.com/porsager/postgres/blob/master/transpile.c...
I’m not sure if I’d made the same choice, but it’s fun the see it can work out great :)