Cloudflare Developers

CD

Cloudflare Developers

Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news

Join
AAJR5/14/2024

Postgres.js with default settings doesn'

Postgres.js with default settings doesn't play very nicely with Hyperdrive at the moment. We're planning a release to roll out in the next couple weeks that will help that significantly. In short, postgres.js uses named prepared statements by default and that can cause several additional round trips depending on your query pattern. For right now if you want to try testing again using node-postgres for best performance that's the best bet. You can also use prepare: false when setting up your connection with postgres.js to help ameliorate some of the performance penalty....
Tthomasgauvin5/6/2024

Hi @AutumnCicada! What database are you

Hi @AutumnCicada! What database are you connecting to? It would depend on that. Check out this doc, in the Connection Method, it will indicate how the connection is done. https://developers.cloudflare.com/workers/databases/connecting-to-databases/ There are 2 recommended ways to connect to databases from Workers, depending on your database type: Hyperdrive or API via client library. Traditional SQL databases (like traditional Postgres) should be connected to with Hyperdrive to ensure the connection works well and you don't exhaust your connection limits. ...
JJames4/1/2024

Hyperdrive bindings exist in the Pages

Hyperdrive bindings exist in the Pages Projects API under hyperdrive_bindings. You won't be able to use the pg driver, but you can use the Postgres.js driver which only requires the compat flag nodejs_compat (not old node_compat) and it works 🙂
Eelithrar3/22/2024

Postgres-js Distributed Performance

Couple of questions: - Why prepare: false - ? (that's going to slow things down!) - Don't define timeouts or lifetimes. - Have you tried the pg driver? We've noticed issues with Postgres.js and working with the maintainer to figure out why...
Mmoody 💭3/21/2024

super sick, would love to hear some

super sick, would love to hear some details
Bbryan2/4/2024

Thread

thanks Jon! is there a way to economically run accelerate just for connection pooling?
SSam12/14/2023

The script will never generate a response

Ok that's not the reason, it's not working in production either. Creating a thread to paste the code. (Sorry for tagging: @kian)
PSPaul Shriner12/8/2023

debugging client.connect()

Hey Matt! Here is the binding config.. The weird thing is that all of the workers are hitting the exact same DB and instance. ```hyperdrive = [...
No description
DDanielZero11/25/2023

Yeah I know, just wanted to throw out

Yeah I know, just wanted to throw out there that it's not super specific. Neon also has PostgREST support. 🙂
CColin10/29/2023

Sporadic Connection Errors

Hi Hyperdrive team 👋 We're definitely seeing some localized connection issues (seems to be from EU-based colos only), and they happen on a spike and then disappear over the next ~10m
HIAHello, I’m Alastair!10/20/2023

AFAIK `unstable_dev` is local-only, so

AFAIK unstable_dev is local-only, so it might be failing because Hyperdrive doesn't work locally?