Florian
PPrisma
•Created by Florian on 6/29/2024 in #help-and-questions
How do you organize your Prisma.validator schemas?
Right now I have them in lib/types.ts together with other types and interfaces. But I don't know if that's the right place.
3 replies
PPrisma
•Created by Florian on 6/4/2024 in #help-and-questions
Type-safety for dates when returning DB entries as JSON
Because when I fetch a prisma object in a server component, I also get a Date back
11 replies
PPrisma
•Created by Florian on 6/4/2024 in #help-and-questions
Type-safety for dates when returning DB entries as JSON
I think so. But I decided to create a wrapper around fetch that parses timestamp strings back to Date objects:
11 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
Thank you for the hint
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
A related question: Is it correct to create functions like
getPostInclude
around Prisma.validator
? I do that because I need the authenticated user's ID in the query.18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
I'll try your suggestion and remove the separation between quotes and reposts. It will only get rid of one FK but maybe that's enough.
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
I'm not a database expert
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
It already feels impossible to work with in its current form
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
This will become even more complex if I ever need to add more FKs and query them. I was wondering if my whole DB structure is wrong.
18 replies
PPrisma
•Created by Florian on 6/4/2024 in #help-and-questions
Type-safety for dates when returning DB entries as JSON
I don't want to litter my components with
Jsonify<T>
11 replies
PPrisma
•Created by Florian on 6/4/2024 in #help-and-questions
Type-safety for dates when returning DB entries as JSON
Right. I just want to know how this is commonly handled? The best approach seems to be to parse it back to Date when I retrieve the json response.
11 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
In my JS code, the additional distinction helps
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
Yes but this is almost what I have, isn't it? I have a
repostOfId
FK. I could get rid of the quoteOfPostId
with your suggestions, but would that make the structure a lot easier?18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
This all works but the types are really messy
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
If the post is a repost of another post, the
Post.tsx
component detects this and decides which post to show:
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
Some feeds render parent posts if one exists:
18 replies
PPrisma
•Created by Florian on 6/12/2024 in #help-and-questions
Tips on designing this recursive database model
18 replies
PPrisma
•Created by Florian on 6/4/2024 in #help-and-questions
Type-safety for dates when returning DB entries as JSON
Thank you! I don't necessarily need the data, but I want a type that doesn't lie to me.
11 replies
PPrisma
•Created by Florian on 5/24/2024 in #help-and-questions
No index found for fulltext search over relation (Planetscale)
Ok turns out I had to write the query like this
4 replies
PPrisma
•Created by Florian on 5/11/2024 in #help-and-questions
Extra query into object (GetPayload)
thank you
5 replies