How to switch from sqllite to PostgreSQL(railway.app)

I was working on an application using T3 stack and sqllite and everything was working perfectly but when I switched to PostgreSQL, it stopped working any idea whats wrong?
48 Replies
Zero
Zero3y ago
Typically you should get some type of error message. Follow the call stack
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
theres an next-dev.js?3515:20 TRPCClientError: Invalid prisma.expenses.create() invocation: i used db push after setting up the railway app yup
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
sure
aditya
aditya3y ago
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
no error
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
let me try but this same code was working for sqllite
Zero
Zero3y ago
They're both different technologies So there will be mismatch between both
aditya
aditya3y ago
aditya
aditya3y ago
ahhh i see any idea how to convert? docs or tutorial will help
Zero
Zero3y ago
I mean the error itself is telling you what's wrong. Wallet ID doesn't seem to exist there. What does your schema look like? Also you might need to delete node_modules and regenerate the client
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
aditya
aditya3y ago
the schema im using
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
i was following this tut
aditya
aditya3y ago
TomDoesTech
YouTube
Build a Blog With the T3 Stack - tRPC, TypeScript, Next.js, Prisma...
Repository: https://github.com/TomDoesTech/trpc-tutorial tRPC docs: https://trpc.io/ In this video, we will build a blog with the T3 stack, tRPC, TypeScript, Next.js, Prisma & Zod. The blog will include a basic one-time password authentication strategy, and the ability to create blog posts. 0:00 Introduction 4:17 Demo 5:53 Code walk-through 20...
Zero
Zero3y ago
It's connect a record to a related record
aditya
aditya3y ago
here he used to connect 2 tables (afaik)
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Zero
Zero3y ago
Yeah you can use it in a create
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Zero
Zero3y ago
Yeah in his case
aditya
aditya3y ago
you mean w/o connect?
Zero
Zero3y ago
Yup
aditya
aditya3y ago
nope not working
Zero
Zero3y ago
I know why I think Instead of walletId just type in Id Because when you do connect it'll give you the wallet type not the expenses type Wallet doesn't contain walletId, it'll contain id
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Zero
Zero3y ago
return ctx.prisma.expenses.create({
data: {
...input,
wallet: {
connect: {
id: wallet.id,
},
}
},
})
return ctx.prisma.expenses.create({
data: {
...input,
wallet: {
connect: {
id: wallet.id,
},
}
},
})
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
aditya
aditya3y ago
aditya
aditya3y ago
i think i have to give it a wallet field here
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
umm yeah i think that is the case because its not getting created at login
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
no problem thanks for the help but now new problem the wallet is not getting created :///
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
aditya
aditya3y ago
aditya
aditya3y ago
GitHub
GitHub - aditya-exe/expense-tracker
Contribute to aditya-exe/expense-tracker development by creating an account on GitHub.
aditya
aditya3y ago
link to the repo like you said the wallet is undefined it is not getting created
Zero
Zero3y ago
You're probably going to need protectedRouter here not the standard router because you expect some type of user to already be in the request context
aditya
aditya3y ago
what do you mean by that?
Want results from more Discord servers?
Add your server