rykuno
Explore posts from serversDTDrizzle Team
•Created by rykuno on 8/26/2023 in #help
Optional/Default value for Relational `Extras`
I have a couple cases where a default/optional value for "extras" in the relational query builder could come in handy. I only really want to run this if the user is logged in. ATM I have the following solution
If there is no auth user it just sets the user_id to null but its not exactly ideal. Is there any plans or current way to optionally add this statement within the same return block?
9 replies
DTDrizzle Team
•Created by rykuno on 7/2/2023 in #help
PGEnum -> Typescript Enum
Hey there. Is there any convenient way people have found to conveniently turn a pgEnum into a typescript enum such as below? Currently I'm creating DTO's but i figured coupling them would be much easier :). I figure ZOD might come into play but we are utilizing NestJS w/ class-validator atm.
5 replies
DTDrizzle Team
•Created by rykuno on 5/28/2023 in #help
Relation Query - Get likes in post
Playing around with relational queries and I'm not quite getting how I'd retrieve the count of likes on a given post.
I'm able to accomplish this in sql, but I'm having a hard time translating or failing to understand why i cant translate this to drizzle.
7 replies
DTDrizzle Team
•Created by rykuno on 5/13/2023 in #help
Custom `Select` object returns type `any`
Databases like Planetscale do not support FK constraints. As I understand I can manipulate the returned data structure from within the
select
clause.
The data structure returned is correct but there is a typescript error casting it to any. Is there a way to fix this or am I misusing select?
1 replies