Florian
PPrisma
•Created by Florian on 6/29/2024 in #help-and-questions
How do you organize your Prisma.validator schemas?
I have a bunch of predefined
select
and include
schemas. Where do I put them in my project? I need some inspiration.
3 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
I used to use Prisma in server components where I don't need to do serialization.
Now I need to return DB entries from an API route handler in JSON form.
This means, the Date type of the Prisma model is not correct on the client anymore. JSONification turns the Date into a string.
What's the correct way to handle this on the client so I have type-safety?
11 replies
PPrisma
•Created by Florian on 5/24/2024 in #help-and-questions
No index found for fulltext search over relation (Planetscale)
I'm trying to find "favorited companions" combined with the ability to search through them.
As you can see in my code, I search inside a relation query. But I get an error that no index could be found.
Is this not possible with Planetscale?
Searching throug companions directly works. The search index on
name
+ description
exists. But I don't know what index I could add to the favorites model to make this work.
4 replies
PPrisma
•Created by Florian on 5/19/2024 in #help-and-questions
Prisma.validator with arguments
Is this the correct way to use Prisma validator (to reuse parts of a query) if the query depends on dynamic data?
2 replies
PPrisma
•Created by Florian on 5/14/2024 in #help-and-questions
Counting hashtags in all posts
I want to build a Twitter-link "trending" feature for which I need to find and count the hashtags inside user posts. What Prisma/Postgres feature would I use for this? Full-text search?
2 replies
PPrisma
•Created by Florian on 5/12/2024 in #help-and-questions
Additional processing after fetching data
I want to fetch posts from my database but additional scrape the opengraph info from the first link in the post. What would be a good abstraction or approach to do this for every request on this model?
2 replies
PPrisma
•Created by Florian on 5/11/2024 in #help-and-questions
Extra query into object (GetPayload)
5 replies