Prisma

P

Prisma

Join the community to ask questions about Prisma and get answers from other members.

Join

findUniqueOrThrow does not throw a PrismaClientKnownRequestError - and NotFoundError is deprecated

Hey, I am writing an exception filter to handle Prisma errors, and was pleased to find the specific error types that have been implemented, e.g. PrismaClientKnownRequestError However, when using 'findUniqueOrThrow' and the record is not found, it does not produce a PrismaClientKnownRequestError - instead it just produces a normal error object with { "name": "NotFoundError",...

Create Project Button is disabled, also page seems to be broken

The accelerate dashboard seems to broken, we cannot create project. I have to remove disable manually from DevTools.
No description

npm migrate deploy Error

Every time I deploy my project on vercel, this step I have a vercel-build command that runs when I deploy my project: “prisma generate && prisma migrate deploy && next build”. And in this command, prisma migrate deploy doesn't work ...
No description

where inside include

hi im using mongodb driver with prisma 5.7.1, ``` const module = await prisma().module.findFirst({ where: { id: moduleId,...

Does Accelerate support using cacheStrategy with groupBy queries on a view?

I'm trying to define a cache strategy for a groupBy query on a view. TypeScript is flagging an error though, saying the type for cacheStrategy is never. From reading the docs for Accelerate it looks like the cache strategy may only be possible on queries on models. Can someone confirm if that's the case?

Prisma `AND` filter not working

```js await prisma.user.update({ where: { AND: [ { id: req.params.id },...

Merge migrations

Is there any way to merge migrations? Sometimes i forgot to add one field, and then i need to create a new migration, and my PR get a lot of unnecessary migrations...
No description

Set max execution timeout

Hi, is there a way with Prisma to set a max query execution timeout? I know there isn't really a built-in way, but was hoping there is a workaround available such as running a raw query directly after client initialization?...

Is it possible to include nested fields in client extensions?

Say i have a a model like this: ```ts model order { //......
Solution:
this is not supported, sadly

getting migration error in prisma

I was unable to migrate my model in prisma, It was showing error while downloading the prisma engine, what should I do
No description

NextJS + Prisma,why is a 2M WASM file generated?

Guys, I need your help I use NextJS + Prisma + CloudFlare D1 to build the app When uploading and packaging, it actually produced a 2M wasm file, causing the entire package file to be too large and the deployment to be unsuccessful....

RDS Proxy with Prisma

Hey team, I have a question about using RDS proxy with Prisma. This prisma doc https://www.prisma.io/docs/orm/prisma-client/deployment/caveats-when-deploying-to-aws-platforms says that there is no benefit of using RDS proxy with Prisma because of pinning issue, but this AWS post https://aws.amazon.com/blogs/database/amazon-rds-proxy-multiplexing-support-for-postgresql-extended-query-protocol/ says that connection pinning is not an issue anymore because of "PostgreSQL Extended Query Protocol". Ca...

orderBy on a relation include

Hello, I am hoping for some assistance with the best way to handle my query and see what is possible. ``` const items = await prisma.items.findMany({ include: { item_categories_item_categories_item_idTocategories: {...

QueryError(MixedParams) after Google Cloud hosting service

I'm getting this error after changing the ENV('DATABASE_URL') to the string connection Cloud SQL from Google Cloud provides. When I try the same query with the prisma.$queryRaw function the error disappears. Any ideas?...
No description

Deploy failed in the cloudflare pages dashboard with prisma.

Will you try this branch https://github.com/iflamed/hono-react-ssr-shadcn-ui/tree/prisma-debug , Follow these command below will deploy success in the cli, but failed on the cloudflare dashboard. ``` npm run install npx prisma generate npm run deploy...
Solution:
Finally I switched to drizzle-orm. I was using Prisma, which is too big for cloudflare sites. For free users of cloudflare, there is a 1MB size limit for each worker script.

Convert Raw Query back to prisma type

Is there any utility function to convert the result of a raw query back to prisma types? ```{ _id: { '$oid': '6587f42a8aad36c44d06e712' }, type: 'Feature',...

When db is updated how to get that alter into prisma?

Hello- I am new to prisma & wondering any good resources or tutorials about moving structure down from the database or up from the schema? Also if the database is altered slightly such as adding a column to a table; how can we update our prisma in our app? I understand that if we update the schema.prisma file with adding a column we can then run a "prisma migrate dev" & it will alter the db but how can we do the same but if there is an update in the DB & we want to update our code? ...

[Prisma] Nested create with 2 levels of related records

Say I have an object: ```js const params = { name: 'bob', age: '25',...

[Neon] [Driver Adapters] Do we need DIRECT_URL if using Driver Adapters?

So I have been migrating Planetscale DB to Neon and I was wondering if we need to provide DIRECT_URL for migrations when using Diriver Adapters? I could not find that information here: https://www.prisma.io/docs/orm/overview/databases/neon#how-to-use-neons-serverless-driver-with-prisma-orm-preview I am checking "Pooled connection" check box when procuring the connection string. Based on this, https://www.prisma.io/docs/orm/overview/databases/neon#how-to-use-neons-serverless-driver-with-prisma-orm-preview, when we needed to use pooling with PgBouncer, we needed to provide DIRECT_URL....

How to setup Next js apps on Vercel using Prisma....

I've been fighting bugs for ages, Mye learning journey is stuck for months just because i couldn't find a way to deploy my next js app on vercel that uses Prisma and MongoDB, I really have a question How to deploy on vercel with my prisma powered next app? Can I use accelerate on vercel? here are my files and how I use them: ```ts...