Tutorial - Connect to a PostgreSQL database with Cloudflare Workers - Client is not defined

I am on step 5. Connect to a PostgreSQL database with Cloudflare Workers and I get an error like Client is not defined. Am I missing a step here? here is my code https://github.com/kusl/cfwhoneynutcheerios/blob/de55ca525d62538540128244514575d4accec706/src/index.ts#L7 https://developers.cloudflare.com/workers/tutorials/postgres/
Connect to a PostgreSQL database with Cloudflare Workers · Cloudfla...
In this tutorial, you will learn how to create a Cloudflare Workers application and connect it to a PostgreSQL database using TCP Sockets. The Workers …
GitHub
cfwhoneynutcheerios/src/index.ts at de55ca525d62538540128244514575d...
Contribute to kusl/cfwhoneynutcheerios development by creating an account on GitHub.
No description
2 Replies
kian
kian12mo ago
Client isn't built-in to Cloudflare Workers, you're missing the import. https://developers.cloudflare.com/workers/tutorials/postgres/#4-connect-to-the-postgresql-database-in-the-worker
import { Client } from "pg";
import { Client } from "pg";
I can see how that tutorial is confusing though
pat
patOP11mo ago
thank you, got it working now @kian how do I mark it as solved? can you mark it as solved for me?
Want results from more Discord servers?
Add your server