opengb icon indicating copy to clipboard operation
opengb copied to clipboard

Fork node-postgres to add option to force pg-cloudflare

Open NathanFlurry opened this issue 8 months ago • 3 comments

Motivation

Currently, we depend on node-postgres automagically detecting the Cloudflare runtime by:

  1. Defining the user agent in esbuild: https://github.com/cloudflare/workers-sdk/blob/e8997b879605fb2eabc3e241086feb7aa219ef03/packages/wrangler/src/deployment-bundle/bundle.ts#L306
  2. Reading the defined user agent: https://github.com/brianc/node-postgres/blob/50c06f9bc6ff2ca1e8d7b7268b9af54ce49d72c1/packages/pg/lib/stream.js#L60

Implementation

We shouldn't have to force our user agent to Cloudflare. We should allow passing in a string forcing it to use pg-cloudflare.

NathanFlurry avatar Jun 23 '24 21:06 NathanFlurry