Pluto
Pluto
TTCTheo's Typesafe Cult
Created by Pluto on 3/15/2023 in #questions
adding required fields to a prisma table while having data
So if i migrate it as optional , then add values to all the existing rows and change it to required , prisma will allow that?
5 replies
TTCTheo's Typesafe Cult
Created by fotoflo on 1/21/2023 in #questions
Prisma CreateMany with a relation (connect)
Sorry if it's not much relevant to your question
34 replies
TTCTheo's Typesafe Cult
Created by fotoflo on 1/21/2023 in #questions
Prisma CreateMany with a relation (connect)
Prisma docs have clearly mentioned that you cannot use connect inside batch queries. If your user and post is a mapping table and performance isn't your top concern ,
primsa.$transaction( async(tx)=>{

const posts = await tx.createmany() // without connecting users

posts.forEach((post)=> {
tx.userPostMapping.create({
data : {
postId : post.id ,
userId : user.id
}
})
})

primsa.$transaction( async(tx)=>{

const posts = await tx.createmany() // without connecting users

posts.forEach((post)=> {
tx.userPostMapping.create({
data : {
postId : post.id ,
userId : user.id
}
})
})

It's a bad solution probably and I've been trying to find better one. Still no luck. Ofcourse apart from raw sql
34 replies
TTCTheo's Typesafe Cult
Created by Prabhath on 1/4/2023 in #questions
Can anyone share an example trpc mutation based onSubmit values from a form
You're declaring mutation itself in function which is wrong and not needed You can simply put your mutation at the top of your component like
const mutation = trpc.cform.useMutation()
const mutation = trpc.cform.useMutation()
And later on in your submit function .
const onSubmit = async () => {

// ...
await mutation.mutateAsync(nform)

console.log('completed mutation successfully');
const onSubmit = async () => {

// ...
await mutation.mutateAsync(nform)

console.log('completed mutation successfully');
7 replies
TTCTheo's Typesafe Cult
Created by Pluto on 12/24/2022 in #questions
Using multiple git accounts in VsCode
I found this today on stackoverflow. It's very detailed and allows to use different account across different projects
7 replies
TTCTheo's Typesafe Cult
Created by Pluto on 12/24/2022 in #questions
Using multiple git accounts in VsCode
Hi. Thanks a alot for answering
7 replies
TTCTheo's Typesafe Cult
Created by Pluto on 11/21/2022 in #questions
Unable to send file to backend in trpc
Do you know any way to decode the encoded file properly? I couldn't find any solution .
16 replies
TTCTheo's Typesafe Cult
Created by Pluto on 11/21/2022 in #questions
Unable to send file to backend in trpc
Thanks
16 replies
TTCTheo's Typesafe Cult
Created by Pluto on 11/21/2022 in #questions
Unable to send file to backend in trpc
OKay
16 replies
TTCTheo's Typesafe Cult
Created by Pluto on 11/21/2022 in #questions
Unable to send file to backend in trpc
Currently , Send to backend , Process the input , Upload that cover image to google drive & store its url to my mysql db
16 replies
TTCTheo's Typesafe Cult
Created by Pluto on 11/21/2022 in #questions
Unable to send file to backend in trpc
So how to solve it then?
16 replies
TTCTheo's Typesafe Cult
Created by Pluto on 10/28/2022 in #questions
how exactly bundle size works
Thanks a ton for explaining 😃.
8 replies
TTCTheo's Typesafe Cult
Created by Pluto on 10/25/2022 in #questions
Alternatives to redux for app state management
Thanks alot for help. Way better than redux❤️
6 replies
TTCTheo's Typesafe Cult
Created by Pluto on 10/25/2022 in #questions
Alternatives to redux for app state management
Thanks. I'll try that out
6 replies