Leonidas
Leonidas
TTCTheo's Typesafe Cult
Created by colten909 on 9/20/2023 in #questions
Prisma Seeding
Tsx is a typescript runner just like ts-node, but doesnt make your life a headache due to good defaults
6 replies
TTCTheo's Typesafe Cult
Created by colten909 on 9/20/2023 in #questions
Prisma Seeding
Try „npx tsx prisma/seed.ts“
6 replies
TTCTheo's Typesafe Cult
Created by benekuehn on 1/7/2024 in #questions
Vercel deployment errors as soon as Prisma enters the show
Does vercel support bun? It seems like you are using it
7 replies
TTCTheo's Typesafe Cult
Created by s☻d on 6/24/2023 in #questions
NextJS 405 response (Exceeding response size limit)
That would be the first and best strategy
7 replies
TTCTheo's Typesafe Cult
Created by s☻d on 6/24/2023 in #questions
NextJS 405 response (Exceeding response size limit)
But only if you have already paginated your requests
7 replies
TTCTheo's Typesafe Cult
Created by s☻d on 6/24/2023 in #questions
NextJS 405 response (Exceeding response size limit)
If some data truly is huge, this is definitely the way to go
7 replies
TTCTheo's Typesafe Cult
Created by s☻d on 6/24/2023 in #questions
NextJS 405 response (Exceeding response size limit)
Api configs only affect the route they are defined in in next
7 replies
TTCTheo's Typesafe Cult
Created by ok ok ok on 6/23/2023 in #questions
Should I use postman? I am trying to start using APIs in my personal projects.
I personally like the simpler vscode extension ThunderClient - but that doesnt devalue postman
6 replies
TTCTheo's Typesafe Cult
Created by ok ok ok on 6/23/2023 in #questions
Should I use postman? I am trying to start using APIs in my personal projects.
If you find it helpful surely. Its a tool
6 replies
TTCTheo's Typesafe Cult
Created by Blankeos on 6/22/2023 in #questions
Is there a way to use the trpc client inside a useEffect? Or a separate "service".
Are you looking for a framework agnostic way to use trpc?
18 replies
TTCTheo's Typesafe Cult
Created by Blankeos on 6/22/2023 in #questions
Is there a way to use the trpc client inside a useEffect? Or a separate "service".
18 replies
TTCTheo's Typesafe Cult
Created by Blankeos on 6/22/2023 in #questions
Is there a way to use the trpc client inside a useEffect? Or a separate "service".
Sounds like you should put this logic into a custom hook tbh - a monolithic component does not sound nice for such loading logic. I would prefer to see a „useLoadXYZ“ in a page component
18 replies
TTCTheo's Typesafe Cult
Created by shineslove on 3/15/2023 in #questions
How to handle key press events in React?
Keep it simple: <div onKeyDown={(e)=>{ if (e.key === „ArrowRight“) doThat() if (e.key === „ArrowLeft“) doThis() }}> ….. </div>
8 replies
TTCTheo's Typesafe Cult
Created by Web Dev Cody on 2/23/2023 in #questions
tRPC response time sometimes takes very long
119 replies
TTCTheo's Typesafe Cult
Created by fotoflo on 1/21/2023 in #questions
Prisma CreateMany with a relation (connect)
I haven‘t, but i am convinced it works. That is exactly what i do when writing raw sql for this - just way simpler and typesafe😅
34 replies
TTCTheo's Typesafe Cult
Created by fotoflo on 1/21/2023 in #questions
Prisma CreateMany with a relation (connect)
Nice! Thank you for sharing this. Setting one-to-one and one-to-many relations is supported by regular Prisma with this method☝🏼 Only for many-to-many relations raw SQL or Kysely would be needed
34 replies
TTCTheo's Typesafe Cult
Created by fotoflo on 1/21/2023 in #questions
Prisma CreateMany with a relation (connect)
According to kysely‘s docs a recursive CTE can be accomplished in kysely (withRecursive). That looks really promising! I should definitely try out Kysely the next time I encounter such an issue✌🏼 @fotoflo i would argue that raw sql is Prismas only option that solves your „createMany with relation“ issue. If you are looking for a type safe approach with semi-raw sql queries Kysely is my recommendation. It can generate its internal types from retrospection (just like Prisma), so using Kysely complementary to Prisma should work (atleast in theory)
34 replies
TTCTheo's Typesafe Cult
Created by fotoflo on 1/21/2023 in #questions
Prisma CreateMany with a relation (connect)
Kysely looks like a wonderful tool. I am not questioning the value it brings. I am questioning the value it brings when you already use prisma for you queries and simply want an escape hatch for using more powerful features of sql when optimizing a query
34 replies