Internal server error: Error connecting to database: fetch failed
I'm trying to send the following query to my db but it eventually times out, throwing an error:
If I comment out the
facilities
query, the city
query returns just fine, so I don't think there's anything wrong with my env setup or connector code. This is also the same query that I previously sent via prisma (or at least, my best attempt at recreating it), and it worked there, so I don't think the query is failing due to its intrinsic size.
Any ideas as to how to resolve this issue?1 Reply
Here's how I'm connecting to my db:
It looks like when I remove
amenityToFacility
from the with
block, it seems to work as intended (and as quickly as I'd expect)
Here's what my amenityToFacility
relation looks like:
(please forgive the undescriptive column names, they were autogenerated by prisma)
Commenting out amenityToFacilityRelations
in schema.ts
dramatically speeds up the code, even compared to circumstances where I wasn't ever referencing that relation
So it seems that either I didn't define my relations correctly, or Drizzle has some performance issue in handling many-to-many relations. Would appreciate any insight anyone has into this!