moroshko
Explore posts from serversDTDrizzle Team
•Created by moroshko on 6/8/2024 in #help
How to type an optional included relation?
I'd like to implement a function that given an email returns a user.
The function also gets an optional
includeContacts
boolean. When true
, all user contacts should be returned as well.
Here is what I currently have:
The problem is that user contacts
are not included in the returned type.
Ideally, contacts
will be a non-optional field in the returned type when includeContacts
is true.
Is this possible to achieve?
Here is my schema:
2 replies
DTDrizzle Team
•Created by moroshko on 8/7/2023 in #help
How to separate Dev data from Prod data with one Postgres instance?
I'd love to use Drizzle with Vercel's Postgres Storage (Neon). On the Hobby plan, Vercel offers only one Postgres instance.
I realize it's not a Drizzle specific question, but would love to know what's the easiest/best practice these days to separate Dev data from Prod data if all I have is a single Postgres instance? Any references to publicly available code examples would be hugely appreciated 🙏
1 replies