sixfalls
sixfalls
Explore posts from servers
DTDrizzle Team
Created by sixfalls on 6/7/2024 in #help
Unable to query a table with another many to many relation
This seems to be an issue with the type handling, but it also could be an oversight on my part. I have 3 tables, let's call them A, B, and C. A and B have a one to many relation, and B and C also has another one to many relation. I have references to A from B, and references to B from C, but none from A to C. I'm trying to query B using db.query.B.findFirst({with: {C: true}), so I can get the C records of B. The inferred type of with ends up becoming {}, and as a result the response of that doesn't have the types for the relation. On the other hand, if I delete the relations between A and B from my drizzle schema file, the query works fine. What gives?
2 replies