Jazon
Explore posts from serversTTCTheo's Typesafe Cult
•Created by Jazon on 11/14/2023 in #questions
Can't pass PrismaLibSQL client-adapter to PrismaClient
I am using the T3-stack with Prisma. I just installed the required libraries for Turso. But when I try to setup the adapter into the PrismaClient. I receive a type error on the adapter passed to the client. Its like the PrismaClient class doesn't expect a value of adapter, no?
2 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 10/14/2023 in #questions
How do I query self-relations?
I guess my schema must be wrong. But I think I've followed the Prisma docs carefully. I currently have the schema beneath. I am trying to query a user by its id, and include the
following
and followedBy
. But it aint working. I am just receiving the 500 status (from the catch block).
The schema
The query
12 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 9/13/2023 in #questions
Next Auth middleware redirects me to the login page, even if there's a session
I am busting my head around this thing. I tried to setup NextJS with NextAuth, Drizzle and PlanetScale. So I am not using the T3-scaffold. The thing is that I can see that there's a user returned from
getServerSession
. But when I add my middleware.ts file. It just keeps redirecting me to the login page. As if there would be no session the middleware could recognize.
Any ideas to why?4 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 4/23/2023 in #questions
Handle many-to-many relations in Prisma with MySQL
I am struggling with creating a schema that works in Prisma with MySQL. I've read an article at prisma.io regarding the subject, but couldn't figure out how to solve my own problem.
Here's the schema:
Basically. Every
User
should be able to have several ShoppingLists
. And the ShoppingLists
can contain several Items
.9 replies
TTCTheo's Typesafe Cult
•Created by Jazon on 4/12/2023 in #questions
Is it safe to get all data based on a route query parameter?
I have a dynamic route which renders a single Project-page. The page itself is being rendered based on the id of the route-query. Like this:
Inside this page I am also fetching (and mutate) all the categories that belongs to this project. I am doing this by looking at what projectId the route-query has. Like this:
I feel like this is kinda unsafe though. Wouldn't another user just be able to enter this projectId into their browser, and be able to see all the categories? Should I also check that the author is the current signed in user?
I am also seeing an error that projectId is undefined at first render, but the categories is being fetched anyway.
7 replies