Dari
Dari
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Dari on 7/24/2024 in #questions
Why is HydrateClient in page.tsx and not in layout.tsx?
Hey I was wondering why the HydrateClient Component is not in the root layout. I couldn't think about a scenario where I wouldn't want to hydrate it 🤔
1 replies
TTCTheo's Typesafe Cult
Created by Dari on 2/22/2024 in #questions
Is it bad to get db without context?
Hey, i was doing some code splitting in my create-t3-turbo app. I found out that i can access the (drizzle) db client without the context. So instead of ctx.db i just imported db from '@acme/db'. I was wondering if there is a downside to this approach and why db was added to the context then? It certainly makes my code cleaner because i don't have to pass the db client to functions.
4 replies
TTCTheo's Typesafe Cult
Created by Dari on 3/22/2023 in #questions
How to chain useQuery calls? | Use result from one query as input for another?
23 replies
TTCTheo's Typesafe Cult
Created by Dari on 1/9/2023 in #questions
How bad is revealing ids really?
Hey, I am currently not using DTOs or sth similar. And I was wondering how bad it really is if i expose my primary keys of a table in my frontend by giving over the whole object returned by the prisma client. I know it's bad practice and seen as a security breach ... but I never fully understood why. If I send a DTO with the same values but some uuid instead of the id (primary key) i still have to persist the uuid in the table and although it is not the primary key ... it is still an identifier that i have to use and a "hacker" could use too.
9 replies