Relations in schema

Hi, I am a little bit confused about defining relations and foreign keys, why I need to define application level relation with "relations" keyword if I can just define foreign key by references and use it in my select query with join statement?
No description
3 Replies
jmandrosz
jmandroszOP10mo ago
Okay, I assume that this is only for "query api" and if I want to use only regular select statements I can ignore this, am I right?
AstroBear
AstroBear10mo ago
Yes, I think relations are only used in "queries" (prisma-like selects). You don't need them when using selects
Mykhailo
Mykhailo10mo ago
you are right, there is a bit more info https://orm.drizzle.team/docs/rqb#foreign-keys
Drizzle ORM - next gen TypeScript ORM
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
No description
Want results from more Discord servers?
Add your server