Andy Young

Results 42 comments of Andy Young

> @andyjy when i applied your patch to the crypto file I now get this: ~ah ok, turns out I am using `import { Pool } from "pg"` in my...

> 🤔 _Can_ `node-postgres` even work in the edge runtime by Vercel and Next.js? Isn't it missing TCP socket support, and Vercel does not offer a [`connect()` like Cloudflare](https://blog.cloudflare.com/workers-tcp-socket-api-connect-databases) does,...

@janpio here's [the reproduction repo](https://github.com/andyjy/mre-pg-nextjs-edge) deployed directly to cloudflare via @cloudflare/next-on-pages .. it works(!) - connecting to a Neon database using node-postgres: - Pages router API route: https://44d82908.mre-pg-nextjs-edge.pages.dev/api/hello - App...

@janpio ..and here it is deployed to Cloudflare [with Prisma added](https://github.com/andyjy/mre-pg-nextjs-edge/commit/abe4a1f24c9e8ad39742ae56c51cb4eeddefb84b) (via `@prisma/adapter-pg`): Pages router API route: https://d2ff1a42.mre-pg-nextjs-edge.pages.dev/api/hello-app App router: https://d2ff1a42.mre-pg-nextjs-edge.pages.dev/api/hello-app Edge middleware: https://d2ff1a42.mre-pg-nextjs-edge.pages.dev/api/foo

> Do I understand correctly that you seem a way to make `pg` work on Cloudflare Pages via `next-on-pages` via some changes Exactly! And specifically those changes are: > 1....

The upstream issue was fixed, Cloudflare Workers now passes async context across custom Thenables https://github.com/cloudflare/workerd/issues/870 @joaquinbentancor you didn't mention whether your problem is when deploying to Vercel; worth calling out...

@jawj I would be happy to update this PR for the new refactor if you would like to accept it? Context/reasoning in the linked issue: https://github.com/neondatabase/serverless/pull/110#issuecomment-2458992991 Small beans really but...

Specifying `maxUses: 1` on the `Pool` constructor fixed the calls hanging for me: ```typescript new Pool({ connectionString, maxUses: 1 }) ``` This fixes the hanging while keeping Neon over websockets,...

Noting here that when I next upgrade to a future release I will update this patch to apply on top of the refactor that just landed. As mentioned above I...

@jawj would you like me to update this PR for the refactor that just landed? If not then it can be closed - was just a few extra minutes work...