Relation join conditions
Hey - let's say I have the following SQL:
Is there any way right now to specify the join condition of the relation, e.g?
2 Replies
No, join conditions only matter at query time. The relation config expects only 3 properties:
fields
, references
, and relationName
. relationName
is only important if distinguishing multiple relations between the same tables.
https://orm.drizzle.team/docs/rqb#declaring-relationsDrizzle ORM - Query
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
No, join conditions only matter at query timeI don't think that's accurate - in my example, the
AND
clause is part of the INNER JOIN
statement and since drizzle's query interface constructs the joins on the developer's behalf, there's no way to specify the join condition.