Mind sharing your account ID and the ID of your Hyperdrive configuration? (both are safe to make pub

Mind sharing your account ID and the ID of your Hyperdrive configuration? (both are safe to make public) We’ll take a look. Wonder if something strange with Xata’s new Postgres connection support.
16 Replies
Igor
Igor3mo ago
CockroachDB requires installing a client CA certificate, yet Cloudflare Hyperdrive doesn't support uploading your own certificates. How is anyone able to connect to CockroachDB with Hyperdrive? (getting the error PostgresError: server requires encryption)
AJR
AJR3mo ago
I'll let someone who knows more about Cockroach chime in if they know a way to accomplish this.
However we are planning to add support for custom CA verification. It's a complex feature so it won't be very soon, but it's on our roadmap (and near the top of it).
$0
$03mo ago
How to use google alloydb with hyperdrive? I can't specify 0.0.0.0/0 as the public IP. https://blog.cloudflare.com/it-it/hyperdrive-making-regional-databases-feel-distributed
The Cloudflare Blog
Hyperdrive: making databases feel like they’re global
Hyperdrive makes accessing your existing databases from Cloudflare Workers, wherever they are running, hyper fast.
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Emerson Macedo
Emerson Macedo3mo ago
For sure. I'll share right now
$0
$03mo ago
Is there a solution?
thomasgauvin
thomasgauvin3mo ago
Responded in thread Same here
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
AJR
AJR3mo ago
Folks use Hyperdrive with pages , see https://discord.com/channels/595317990191398933/1255556120781656105/1255556819498045461 for a recent example The recent postgres.js work did a lot to unblock this, as the nodejs_compat flag works with postgres.js, and also with pages, which was I think one of the last blockers there
Mitya
Mitya3mo ago
Does Hyperdrive play nicely with Postgres transactions, or would they conflict in any way? I know Hyperdrive handles pooling, hence the question, whereas PG transactions depend on using a pool client, not on-the-fly, one-off queries.
AJR
AJR3mo ago
It works well with them but they do impose some costs. 1. We don't cache parts of transactions, so you'll always be serving from origin 2. The client holds the connection until the transaction completes or rolls back, which limits the amount of scaling available
Mitya
Mitya3mo ago
Great, thanks for the info.
Unknown User
Unknown User3mo ago
Message Not Public
Sign In & Join Server To View
Mitya
Mitya3mo ago
This may be more a general PG question, but asking here in case there's any HD implications/angle on it: is it advisable to cache the Client instance on req, rather than create it for each query? i.e. instead of:
const runQ = async q => {
const client = new Client(/* options */);
await client.connect();
return client.query(q);
}
const runQ = async q => {
const client = new Client(/* options */);
await client.connect();
return client.query(q);
}
do:
const runQ = async (req, q) => {
if (!req.client) {
req.client = new Client(/* options */);
await req.client.connect();
}
return req.client.query(q);
}
const runQ = async (req, q) => {
if (!req.client) {
req.client = new Client(/* options */);
await req.client.connect();
}
return req.client.query(q);
}
Isaac McFadyen
Isaac McFadyen3mo ago
No. req is new every time and the client will be recycled.
Want results from more Discord servers?
Add your server