Daniel Drozdov
DTDrizzle Team
•Created by Daniel Drozdov on 7/1/2024 in #help
How do errors work?
Follow up on this if I try to insert and it violates a unique constraint will it throw like a Drizzle Error
2 replies
DTDrizzle Team
•Created by Daniel Drozdov on 6/7/2024 in #help
Not sure why we need to make relations when we have foreign keys?
@rubberduckies @A Dapper Raccoon @ohdontmindmeatall
16 replies
DTDrizzle Team
•Created by Daniel Drozdov on 6/7/2024 in #help
Not sure why we need to make relations when we have foreign keys?
I use foriegn keys because I think that is proper db design and maintains some level of referential integrity, not orm specific relations. Relations are really only necessary if you want to use things like with syntax and don't care to deal with aggregating data when its returned:
https://orm.drizzle.team/docs/joins#aggregating-results
Adding relations adds some initial overhead when writing the drizzle schema however it does simplifying db calls and allows you to use with api and not worry about properly aggregating your data(and testing aggregation).
TLDR:
Use FK for referential integrity, use relations to take advantage of some the orm features like with and to avoid having to manage data aggregation. If you just want to use drizzle like a query builder there is no need for relations
16 replies
DTDrizzle Team
•Created by Daniel Drozdov on 6/7/2024 in #help
Not sure why we need to make relations when we have foreign keys?
I started playing around with this
16 replies
DTDrizzle Team
•Created by Daniel Drozdov on 6/7/2024 in #help
Not sure why we need to make relations when we have foreign keys?
Following up @moderator
16 replies