Interaction with dbs

1. Assuming you have a Function at /functions/api/formSubmit you should fetch /api/formSubmit (notice the lack of the /functions part) 2. a heads-up that regular databases are not compatible with Workers or Functions, you'd need to use a database that has an HTTP interface such as Supabase or the newly opened #d1-open-alpha
3 Replies
bkyerv
bkyerv3y ago
Why are functions not compatible with regular databases? Is it because you cannot use adapters like prisma in workers due to cpu limitations? Can I use planetscale via their javascript driver?
Isaac McFadyen
Isaac McFadyenOP3y ago
It's because Workers can't make TCP connections. Planetscale's Javascript driver is HTTP so you're good and that will work Basically Workers (and Functions) can only do HTTP, not TCP (so no regular Postgres without Supabase which has HTTP)
Max (@rozenmd)
or postgres without postgrest (what supabase uses under the hood)
Want results from more Discord servers?
Add your server