Prisma.DbNull doesn't work with Prisma Accelerate
Prisma Accelerate doesn't seem to support Prisma.DbNull. This is unexpected and production-breaking for us since we enabled Accelerate. For example, if you use Accelerate:
And have a model with an option JSON property:
If you try and update the value to Prisma.DbNull, that value becomes an empty object
{}
rather than NULL
in the database and that's what the .update
also responds with.
I can confirm that this is indeed an issue with Accelerate, because when I disable it, it works correctly.2 Replies
Prisma Accelerate doesn't seem to support Prisma.DbNull. This is unexpected and production-breaking for us since we enabled Accelerate. For example, if you use Accelerate:
And have a model with an optional JSON property:
If you try and update the value to Prisma.DbNull, that value becomes an empty object
{}
rather than NULL
in the database and that's what the .update
also responds with.
I can confirm that this is indeed an issue with Accelerate, because when I disable it, it works correctly.Hey @AnandChowdhary
Thanks for raising this. Is this happening on latest version of Prisma v5.20.0?
To confirm, I understand the issue
With Accelerate:
If we update the value to Prisma.DbNull, that value becomes an empty object {} rather than NULL.
Without Accelerate:
The value gets updated to actual NULL value, which is expected and not the empty object.
Correct?
I just tried this with an sample project and got the correct value.
i.e. Not an empty object
I got the expected output: