I feel obliged to namedrop Zapatos here, another postgres JS client with a remarkably similar design (sql in template strings), but fully typesafe. If TypeScript is your thing, you might appreciate it: https://jawj.github.io/zapatos/ Personally I feel it’s one of the best designed (and documented) TS libraries out there and I’m sad it’s not very well known.
PostgresJs: PostgreSQL client for Node.js and Deno
21–30 of 148 posts
Re: PostgresJs: PostgreSQL client for Node.js and Deno
#22I was wondering how old this project is: v1.0.1 - Jan 2020 v2.0.0 - Jun 2020 but never left beta. v3.0.0 - Mar 2022, which appears to be when the project really got started. I also wonder how solid it is, because it looks very interesting.
I've been using it in production (Deno) for a while. It's pretty solid, but their documentation is sorely lacking, so you often have to feel your way to getting more complex things to work.
Re: PostgresJs: PostgreSQL client for Node.js and Deno
#23Earlier quoted context omitted.
We had to abandon Zapatos because a) it doesn’t support multiple schemas; b) the types wouldn’t always be very readable. PgTyped was the alternative, and 2 years later I’m very glad we made the switch.
What do you mean multiple schemas ? What is an example of a non readable type?
CREATE SCHEMA a;
CREATE SCHEMA b;
CREATE TABLE a.foo (id SERIAL PRIMARY KEY);
CREATE TABLE b.foo (id SERIAL PRIMARY KEY);Re: PostgresJs: PostgreSQL client for Node.js and Deno
#24I feel obliged to namedrop Zapatos here, another postgres JS client with a remarkably similar design (sql in template strings), but fully typesafe. If TypeScript is your thing, you might appreciate it: https://jawj.github.io/zapatos/ Personally I feel it’s one of the best designed (and documented) TS libraries out there and I’m sad it’s not very well known.
We had to abandon Zapatos because a) it doesn’t support multiple schemas; b) the types wouldn’t always be very readable. PgTyped was the alternative, and 2 years later I’m very glad we made the switch.
Re: PostgresJs: PostgreSQL client for Node.js and Deno
#25For people who would like a more safe and structured approach (but almost as powerful and with the option to resort to SQL strings if needed) I highly recommend checking out Prisma https://www.prisma.io/
Re: PostgresJs: PostgreSQL client for Node.js and Deno
#26Re: PostgresJs: PostgreSQL client for Node.js and Deno
#27On what makes it postgres.js faster, from author himself:
> it seems Postgres.js is actually faster than, not only pg, but of any driver out-there
Re: PostgresJs: PostgreSQL client for Node.js and Deno
#28Also see: https://github.com/gajus/slonik
+1. I’m a happy user of slonik for several years. Zod integration is very useful
Re: PostgresJs: PostgreSQL client for Node.js and Deno
#29For people who would like a more safe and structured approach (but almost as powerful and with the option to resort to SQL strings if needed) I highly recommend checking out Prisma https://www.prisma.io/
Prisma doesn't do JOINs [0], it just SELECTs everything and joins them in its own engine. It should not be taken seriously. [0]: https://github.com/prisma/prisma/discussions/12715