Skip to content

Failure to create pg Client instance using workers #23250

@aeringamaroff

Description

@aeringamaroff

Example URL(s)

Actual Behavior

I am attempting to create a worker that accesses my AWS RDS database.
Following the docs https://developers.cloudflare.com/hyperdrive/examples/connect-to-postgres/postgres-database-providers/aws-rds-aurora/ I am creating a client as follows:

const client = new Client({ connectionString: env.WRANGLER_HYPERDRIVE_LOCAL_CONNECTION_STRING_MY_DB, });

Attempting to call the worker either in the browser or with curl results in the following error:

CloudflareSocket is not a constructor

Expected Behavior

The worker should connect to the client and run a simple test query:

  await client.connect();

  const result = await client.query('SELECT * FROM users;');

Additional information

No response

Metadata

Metadata

Labels

product:hyperdriveHyperdrive: https://developers.cloudflare.com/hyperdrive/

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions