Hono and cloudflare bindings
I am using hono, orpc, drizzle and supbase. I want to create a db binding because the current set up is causing internal server error with cloudflare workers, database connection is getting created on every request, but i cant seem to find any doc or post about setting it up
2 Replies
You could check out Cloudflare Hyperdrive. It’s meant to optimize third-party connections
You could also try to do something clever with Durable Objects
But Workers are functionally stateless, meaning that you can’t persist db connections the way that you would on a node server
Here’s a very basic example of a Hono + Drizzle + Supabase setup: https://github.com/fiberplane/create-honc-app/tree/6a9fae71524f8b66ae814ef3d4bbb366100ac752/templates/supabase
Lmk if I’ve misunderstood your question/issue
THank you soo much this is what i needed