P
Prisma•8mo ago
Marshmallow

Trying to get into Prisma; lots of hope and heartbreak

Hello! I've been trying to get into Prisma more and more because of the incredible promise and functionality it offers 99.9% of the time. However, I've unfortunately been experiencing some heartbreaking issues that just don't seem to make sense. I am running Node 18.13.0 compiled to js on my server and 20.10.0 pure ts on my pc. Both experience same issues. My server is a Pi, running a minimal CLI OS (Can't remember which!) My pc is running Lubuntu 22 Both my client and prisma are version 5.12.1, but I've been on and off trying to use Prisma for the past over a year with same results/issues. Here is one of them: I've been experiencing this crippling mystery issue that I narrowed down to I believe use of upsert, where it works for the longest time, but then one time out of 1000 maybe it completely explodes and no more Prisma calls work properly from there on until I restart my project. This issue appears to be fixed by manually findFirst -> null check -> create OR update depending if existed Another:
model UserGuildConfig {
item_id Int @id @default(autoincrement())
id String
guild_id String
}
model UserGuildConfig {
item_id Int @id @default(autoincrement())
id String
guild_id String
}
For some reason, when I try to create new entry using only id and guild_id, it complains that field item_id is required and crashes. This yields the same results with upsert or manual findFirst etc.... I apologise in advance for not having any logs to share; I'll make sure to update this post when I have some again. If you have anything that I could Possibly try to help me out, please do let me know!! (PS I am not sure what the difference between ORM/Accelerate/Pulse are - I hope I picked it right! Apologies if not!) Thank you! 💖
No description
6 Replies
Marshmallow
MarshmallowOP•7mo ago
Here's the unique id issue!
Marshmallow
MarshmallowOP•7mo ago
No description
Marshmallow
MarshmallowOP•7mo ago
Why do I need id to be defined..? That's silly!!!
No description
Marshmallow
MarshmallowOP•7mo ago
Why must it not be null..? Isn't that the whole idea of autoincrement..? I am so freakin confused...
janglad
janglad•7mo ago
If you pass it null Prisma will try and set it as such. If you want the field to be ignored whiel also still passing it it should be undefined
Marshmallow
MarshmallowOP•7mo ago
Well I didn't give it a null! But thank you, I'll try to specify undefined! Yeahhhh undefined doesn't work either :c Oh my goodness. No freakin way. BigInt has been my biggest nemesis once again. Oh that's annoying!! But I'm glad I Finally tracked down my issue! BigInt is Soooo annoying!!
Want results from more Discord servers?
Add your server