How do you write a query to get the relations data together with a JOIN or a SUBQUERY?
I need to run something like:
We could also achieve the same result using a JOIN.
However, I want to take advantage of the relations I have created in my schema to retrieve the actual data related to my top table.
As far as I can read on the docs, to get the relations data, you have to use 'findMany' or 'findFirst'
I don't know how to make a JOIN with this syntax neither how to specify a subquery
Can someone help please?
1 Reply
You can use Joins as well with the crud api: https://orm.drizzle.team/docs/joins
Joins [SQL] - Drizzle ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.