Schema that needs to joins twice from the same schema
Right now I have a schema that is like this:
`
The problem is that I cannot retrive the whole data, because if I try to join it in using the code below, it shows the message in the image
Is there a way to have that type of structure or am I limited to 1 join per query?

4 Replies
When joining the same table multiple times, you need to give the table an alias.
https://orm.drizzle.team/docs/joins#aliases--selfjoins
Drizzle ORM - Joins
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
... drizzle is more and more complex everytime I try to use it, lol
wait, why do I need to import that from each core?
is there no "unique api" for that?
Not really sure about imports, but the alias conflict is actually a SQL thing, not drizzle.
This is postgres, but I imagine sqlite has the same issue. This is why you need aliases.


I just ended up like, rolling up my own stuff with knex
drizzle just made my life a bit worse here, sry