serverless icon indicating copy to clipboard operation
serverless copied to clipboard

Postgres.js variant

Open uncomplexity opened this issue 1 year ago • 5 comments

Postgres.js as alternative to pg?

  • https://github.com/porsager/postgres
  • https://github.com/porsager/postgres-benchmarks
  • https://porsager.github.io/imdbench/sql.html
  • https://github.com/kysely-org/kysely-postgres-js
  • https://orm.drizzle.team/docs/get-started-postgresql

uncomplexity avatar Sep 08 '24 13:09 uncomplexity

Thanks for the suggestion. Is there a particular platform that has WebSockets but no TCP you want to use this on?

jawj avatar Sep 08 '24 15:09 jawj

IMHO, Postgres.js is faster and lighter than pg and it's API is more similar to the http api so this could be a way to "unify" the api's in this library.

nicksrandall avatar Sep 11 '24 21:09 nicksrandall

Thanks for the suggestion. Is there a particular platform that has WebSockets but no TCP you want to use this on?

well i thought of using vercel for a project, then i dug deeper i realized they're using this as a dependency, which uses pg.

seconding what @nicksrandall said, i think other users will also benefit from the perf gains.

uncomplexity avatar Sep 11 '24 23:09 uncomplexity

I sent a PR to postgres.js that implements neon's flavor of sql-over-ws: https://github.com/porsager/postgres/pull/955

nicksrandall avatar Oct 03 '24 17:10 nicksrandall

FWIW, we are now using this in production: https://github.com/brevitybuilder/postgres

nicksrandall avatar Oct 17 '24 21:10 nicksrandall