Stivo
Stivo
Explore posts from servers
TtRPC
Created by Stivo on 3/18/2024 in #❓-help
Is there a way to pass parameters to procedure on call?
I would like to pass the required permission to the procedure like in this example:
create: authedProcedure("user.create").input(createUserSchema).mutation(async ({ input }) => {
return createUserHandler({ input })
}),
create: authedProcedure("user.create").input(createUserSchema).mutation(async ({ input }) => {
return createUserHandler({ input })
}),
Any idea how i could achieve this?
3 replies
TTCTheo's Typesafe Cult
Created by Stivo on 9/14/2023 in #questions
Database Query Insights (local MySQL)
I'm using Prisma + MySQL. I'm trying to optimize some queries. What is the best way to get query insights on a local MySQL instance?
2 replies
TtRPC
Created by Stivo on 1/13/2023 in #❓-help
Is it possible to create a generic router to pass a type on?
Hi, I was wondering if it is possible to create a generic router to pass a type which is expected to return
4 replies
TtRPC
Created by Stivo on 1/7/2023 in #❓-help
Right way to catch all unexpected errors before they reach the user
Hi, I was wondering, what's the right way to catch all unexpected errors (like db errors) and replace them with simple "Internal Server Error" erros, before they get to the user. Is it possible to achieve this via middleware?
2 replies
TtRPC
Created by Stivo on 1/5/2023 in #❓-help
Right way to structure your code when using tRPC?
I was wondering how you properly structure your tRPC ruter code? Writing all the code in the routers can become messy quickly. Do you split it up in controller and service files (MVC)?
3 replies
TTCTheo's Typesafe Cult
Created by Stivo on 12/15/2022 in #questions
NextAuth CredentialsProvider + database strategy
It looks like NextAuth does not want you to use the credentials method in combination with a database. Even when providing a database adapter, NextAuth does not store sessions in the database. Is it advisable to just use JWT instead, or switch to another library?
5 replies
TTCTheo's Typesafe Cult
Created by Stivo on 12/13/2022 in #questions
Best way to add CRUD to routers without duplicate code
Is there a best practise on how to add CRUD functionality to multiple routers without repeating the code for it?
1 replies